Example #1
0
        internal IGraphQLType ResolveType(GraphQLParser.AST.OperationType type)
        {
            var schema = ast.Definitions.OfType <GraphQLSchemaDefinition>().FirstOrDefault();

            if (schema != null)
            {
                var namedType = schema.OperationTypes.FirstOrDefault(x => x.Operation == type)?.Type;
                if (namedType != null)
                {
                    return(ResolveType(namedType));
                }
            }
            return(null);
        }
        public static OperationType ToOperationType(OperationTypeParser type)
        {
            switch (type)
            {
            case OperationTypeParser.Query:
                return(OperationType.Query);

            case OperationTypeParser.Mutation:
                return(OperationType.Mutation);

            case OperationTypeParser.Subscription:
                return(OperationType.Subscription);
            }

            throw new ExecutionError($"Unmapped operation type {type}");
        }
Example #3
0
 internal IGraphQLType ResolveType(GraphQLParser.AST.OperationType type)
 {
     return(types.Where(x => x.Name == type.ToString()).Single());
 }