Beispiel #1
0
        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);
        }
Beispiel #2
0
        public void SetUp()
        {
            this.schema = new GraphQLSchema();
            var rootType = new QueryRootType();

            this.schema.AddKnownType(rootType);
            this.schema.AddKnownType(new A());
            this.schema.Query(rootType);
        }
Beispiel #3
0
        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);
        }