public static GraphQLDocument Error(GraphQLError error) { var doc = new GraphQLDocument(); doc.errors.Add(error); return(doc); }
public void Resolve(GraphQLDocument doc) { this.rootType = doc.ResolveType(this.definition.TypeCondition) as IGraphQLFieldCollection; this.Selection.Resolve(doc, this.rootType); this.Path = doc.ResolveQuerySource(this.definition.Location); this.Query = doc.ResolveFragment(this.definition); }
public static GraphQLDocument Error(ErrorCodes code, string message) { var doc = new GraphQLDocument(); doc.AddError(code, message); return(doc); }
public void Resolve(GraphQLDocument doc) { this.Fields = this.definition.Fields.Select(x => new Field(x)).ToList(); foreach (Field f in this.Fields) { f.Resolve(doc); } }
private IEnumerable <InterfaceType> ResolveInterfaces(GraphQLDocument doc) { foreach (var interfaceDefinitionLookup in this.definition.Interfaces) { var actualinterface = doc.ResolveType(interfaceDefinitionLookup); yield return(actualinterface as InterfaceType); } }
public void Resolve(GraphQLDocument doc) { Paramaters = operation.VariableDefinitions?.ToDictionary(x => x.Variable.Name.Value, x => doc.ResolveValueType(x.Type)) ?? new Dictionary <string, ValueTypeReference>(); var rootType = doc.ResolveType(operation.Operation) as IGraphQLFieldCollection; (this.Query, this.Path) = doc.ResolveQuery(operation.Location); Selection.Resolve(doc, rootType); }
internal static Field TypeName(GraphQLDocument doc) { Field field = new Field("__typename"); field.Type = new ValueTypeReference { Type = doc.ResolveType("String"), CanCollectionBeNull = false, CanValueBeNull = false, IsCollection = false }; return(field); }
public void Resolve(GraphQLDocument doc) { this.Type = doc.ResolveValueType(this.definition.Type); //if(this.definition.DefaultValue is ScalerValues sv)!!! //{ // this.DefaultValue = sv.Value; //} //else { this.DefaultValue = this.definition.DefaultValue?.ToString(); } this.Type = doc.ResolveValueType(this.definition.Type); }
public void Resolve(GraphQLDocument doc) { this.Type = doc.ResolveValueType(this.definition.Type); if (this.definition.DefaultValue is GraphQLParser.AST.GraphQLScalarValue sv) { this.DefaultValue = sv.Value; } else { this.DefaultValue = this.definition.DefaultValue?.ToString(); } this.Type = doc.ResolveValueType(this.definition.Type); }
public void Resolve(GraphQLDocument doc) { if (this.Name == "__typename") { return; } if (this.definition != null) { this.Type = doc.ResolveValueType(this.definition.Type); } else if (this.definitionInput != null) { this.Type = doc.ResolveValueType(this.definitionInput.Type); } foreach (Argument a in this.Arguments) { a.Resolve(doc); } }
public void Resolve(GraphQLDocument doc) { if (this.definition != null) { this.Interfaces = ResolveInterfaces(doc).ToList(); this.Fields = this.definition.Fields.Select(x => { return(new Field(x)); }).ToList(); } else if (this.definitionInput != null) { this.Fields = this.definitionInput.Fields.Select(x => { return(new Field(x)); }).ToList(); } foreach (var f in this.Fields) { f.Resolve(doc); } }
public void Resolve(GraphQLDocument doc) { }
public void Resolve(GraphQLDocument doc) { this.Types = this.op.Types.Select(x => doc.ResolveType(x)).ToList(); }