示例#1
0
        private object Visit(GraphQLParser.AST.ASTNode node)
        {
            switch (node)
            {
            case GraphQLOperationDefinition op:
                return(new Operation(op));

            case GraphQLInterfaceTypeDefinition op:
                return(new InterfaceType(op));

            case GraphQLObjectTypeDefinition op:
                return(new ObjectType(op));

            case GraphQLEnumTypeDefinition op:
                return(new EnumType(op));

            case GraphQLUnionTypeDefinition op:
                return(new UnionType(op));

            case GraphQLInputObjectTypeDefinition op:
                return(new ObjectType(op));

            default:
                return(null);
            }
        }
示例#2
0
        private object VisitSelectionSet(GraphQLParser.AST.ASTNode node)
        {
            switch (node)
            {
            case GraphQLFieldSelection op:
                return(new FieldSelection(op));

            default:
                return(node);
            }
        }
示例#3
0
        private object Visit(GraphQLParser.AST.ASTNode node)
        {
            switch (node)
            {
            case GraphQLFieldSelection op:
                return(new FieldSelection(op));

            case GraphQLInlineFragment op:
                return(new SetSelection(op));

            case GraphQLFragmentSpread op:
                return(op.Name);

            default:
                return(node);
            }
        }