public override GraphQLNamedType BeginVisitNamedType( GraphQLNamedType typeCondition) { { Tracker.EnterNamedType?.Invoke(typeCondition); } return(base.BeginVisitNamedType(typeCondition)); }
public void SetUp() { dynamic variables = new ExpandoObject(); variables.scalarIntVariable = "1"; this.intNamedType = GetIntNamedType(); this.schemaRepository = Substitute.For <ISchemaRepository>(); this.variableResolver = new VariableResolver(variables, this.schemaRepository, this.GetVariableDefinitions()); }
public void SetUp() { dynamic variables = new ExpandoObject(); variables.scalarIntVariable = "1"; this.intNamedType = GetIntNamedType(); this.typeTranslator = Substitute.For <ITypeTranslator>(); this.variableResolver = new VariableResolver(variables, this.typeTranslator, this.GetVariableDefinitions()); }
protected virtual GraphQLBaseType GetOutputTypeFromNamedType(GraphQLNamedType type) { var inputType = this.schemaRepository.GetSchemaInputTypeByName(type.Name.Value); if (inputType != null) { return(null); } return(this.schemaRepository.GetSchemaOutputTypeByName(type.Name.Value)); }
public override GraphQLNamedType BeginVisitNamedType(GraphQLNamedType namedType) { var typeName = namedType.Name.Value; var type = this.GetTypeFromSchema(typeName); if (type == null) { this.Errors.Add( new GraphQLException(this.ComposeErrorMessage(typeName), new[] { namedType })); } return(base.BeginVisitNamedType(namedType)); }
protected TypeSyntax GetCSharpTypeFromGraphQLNamedType(GraphQLNamedType type, IEnumerable <ASTNode> allDefinitions, bool nullable = true) { var cSharpType = this.config.GetCSharpTypeFromGraphQLType(type.Name.Value, nullable); if (cSharpType != null) { return(cSharpType); } var enumTypeFromSchema = allDefinitions .Where(e => e.Kind == ASTNodeKind.EnumTypeDefinition) .Cast <GraphQLEnumTypeDefinition>() .SingleOrDefault(e => e.Name.Value == type.Name.Value); if (enumTypeFromSchema != null) { return(nullable ? SyntaxFactory.NullableType(SyntaxFactory.ParseTypeName(type.Name.Value)) : SyntaxFactory.ParseTypeName(type.Name.Value)); } return(SyntaxFactory.ParseTypeName(type.Name.Value)); }
public virtual GraphQLNamedType BeginVisitNamedType(GraphQLNamedType typeCondition) => typeCondition;
public NamedType NamedType(GraphQLNamedType source) { var type = new NamedType(Name(source.Name)).WithLocation(source, _body); return(type); }
protected virtual GraphQLBaseType GetInputTypeFromNamedType(GraphQLNamedType type) { return(this.schemaRepository.GetSchemaInputTypeByName(type.Name.Value)); }