private static void GenerateDependencyInjectionCode(
            CodeGenerationResult result,
            CodeGeneratorContext generatorContext)
        {
            var typeName = generatorContext.Name + "RequestExecutorBuilderExtensions";

            ClassDeclarationSyntax dependencyInjectionCode =
                ClassDeclaration(typeName)
                .AddModifiers(
                    Token(SyntaxKind.PublicKeyword),
                    Token(SyntaxKind.StaticKeyword),
                    Token(SyntaxKind.PartialKeyword))
                .AddGeneratedAttribute();

            var statements = new List <StatementSyntax>
            {
                AddTypeExtension(Global(generatorContext.Namespace + ".Query")),
                AddNeo4JFiltering(),
                AddNeo4JSorting(),
                AddNeo4JProjections(),
                ReturnStatement(IdentifierName("builder"))
            };

            MethodDeclarationSyntax addTypes =
                MethodDeclaration(
                    IdentifierName(Global(IRequestExecutorBuilder)),
                    Identifier("Add" + generatorContext.Name + "Types"))
                .WithModifiers(
                    TokenList(
                        Token(SyntaxKind.PublicKeyword),
                        Token(SyntaxKind.StaticKeyword)))
                .WithParameterList(
                    ParameterList(
                        SingletonSeparatedList(
                            Parameter(Identifier("builder"))
                            .WithModifiers(TokenList(Token(SyntaxKind.ThisKeyword)))
                            .WithType(IdentifierName(Global(IRequestExecutorBuilder))))))
                .WithBody(Block(statements));

            dependencyInjectionCode =
                dependencyInjectionCode.AddMembers(addTypes);

            NamespaceDeclarationSyntax namespaceDeclaration =
                NamespaceDeclaration(IdentifierName(DependencyInjection))
                .AddMembers(dependencyInjectionCode);

            CompilationUnitSyntax compilationUnit =
                CompilationUnit()
                .AddMembers(namespaceDeclaration);

            compilationUnit = compilationUnit.NormalizeWhitespace(elasticTrivia: true);

            result.AddSource(DependencyInjection + $".{typeName}.cs", compilationUnit.ToFullString());
        }
        private static void GenerateObjectType(
            CodeGenerationResult result,
            string @namespace,
            IObjectType objectType)
        {
            TypeNameDirective?typeNameDirective =
                objectType.GetFirstDirective <TypeNameDirective>("typeName");
            var typeName = typeNameDirective?.Name ?? objectType.Name.Value;

            ClassDeclarationSyntax modelDeclaration =
                ClassDeclaration(typeName)
                .AddModifiers(
                    Token(SyntaxKind.PublicKeyword),
                    Token(SyntaxKind.PartialKeyword))
                .AddGeneratedAttribute();

            foreach (IObjectField field in objectType.Fields.Where(t => !t.IsIntrospectionField))
            {
                RelationshipDirective?relationship =
                    field.GetFirstDirective <RelationshipDirective>("relationship");

                modelDeclaration =
                    modelDeclaration.AddProperty(
                        field.GetPropertyName(),
                        IdentifierName(field.GetTypeName(@namespace)),
                        field.Description,
                        setable: true,
                        configure: p =>
                {
                    if (relationship is not null)
                    {
                        p = p.AddNeo4JRelationshipAttribute(
                            relationship.Name,
                            relationship.Direction);
                    }

                    return(p);
                });
            }

            NamespaceDeclarationSyntax namespaceDeclaration =
                NamespaceDeclaration(IdentifierName(@namespace))
                .AddMembers(modelDeclaration);

            CompilationUnitSyntax compilationUnit =
                CompilationUnit()
                .AddMembers(namespaceDeclaration);

            compilationUnit = compilationUnit.NormalizeWhitespace(elasticTrivia: true);

            result.AddSource(@namespace + $".{typeName}.cs", compilationUnit.ToFullString());
        }