public static SingleQuery RootCollection(this SingleQuery singleQuery, QueryRootType type, params Action <QueryNode>[] actions) { var rootNode = CreateRoot(QueryNodeType.Collection, type, actions); var newNode = singleQuery.NodesList.AddFirst(rootNode); return(singleQuery); }
public void SetUp() { this.schema = new GraphQLSchema(); var rootType = new QueryRootType(); this.schema.AddKnownType(rootType); this.schema.AddKnownType(new A()); this.schema.Query(rootType); }
public static QueryNode CreateRoot(QueryNodeType type, QueryRootType rootType, params Action <QueryNode>[] actions) { var rootNode = new QueryNode { Type = type, RootType = rootType, }; actions?.ForEach(x => x.Invoke(rootNode)); return(rootNode); }