예제 #1
0
        public static void Run()
        {
            var q0 = QL.Compile(new Query {
                new students()
                {
                    new name()
                }
            });

            Variables fv = new Variables();

            fv.Type.Value = new StudentInputType {
                class_id = "cid", id = "id", name = "name"
            };

            var q1 = QL.Compile(new Mutation {
                new createStudent(student: fv.Type)
                {
                    new Student_id()
                }
            });
            var output  = q0.Run("http://localhost:4000/graphql");
            var output1 = q1.Run("http://localhost:4000/graphql", fv);
            var output2 = q0.Run("http://localhost:4000/graphql");
        }
예제 #2
0
 public static void Run()
 {
     var q0 = QL.Compile(new Q.GraphQLHubAPI {
         new twitter {
             new TwitterAPI_user(identifier: UserIdentifier.name, identity: "clayallsopp")
             {
                 new created_at(),
                 new description(),
                 new TwitterUser_id(),
                 new screen_name(),
                 new TwitterUser_name(),
                 new profile_image_url(),
                 new url(),
                 new tweets_count(),
                 new followers_count(),
                 new tweets(limit: 1)
                 {
                     new text()
                 }
             },
             new tweet(id: "687433440774459392")
             {
                 new text(),
                 new retweets(limit: 2)
                 {
                     new Retweet_id(),
                     new retweeted_status()
                     {
                         new Tweet_id()
                     },
                     new Retweet_user()
                     {
                         new screen_name()
                     }
                 }
             },
             new search(q: "Javascript", count: 1, result_type: SearchReponse.mixed)
             {
                 new Tweet_user()
                 {
                     new screen_name()
                 },
                 new Tweet_id(),
                 new text()
             }
         }
     });
     var output = q0.Run("https://www.graphqlhub.com/graphql");
 }
예제 #3
0
        public static void Run()
        {
            Q0Variables v = new Q0Variables();

            v.DroidExtra.Value = true;

            var heroInfo = new CharacterFragment(_Meta: new Meta {
                Name = "hero"
            })
            {
                new name(),
                new OnDroid(_Meta: new Meta {
                    Include = new If(v.DroidExtra)
                })
                {
                    new primaryFunction()
                },
                new CharacterFragment(new Meta {
                    Name = "Test", Skip = new If(v.DroidExtra)
                })
                {
                    new id()
                }
            };
            var q0 = QL.Compile(new Q.Query {
                new hero(episode: Episode.EMPIRE)
                {
                    heroInfo
                },
                new hero(episode: Episode.JEDI, _Meta: new Meta {
                    Name = "jedi"
                })
                {
                    heroInfo
                }
            }, "query");
            var output = q0.Run("http://graphql-ruby-demo.herokuapp.com/queries", v);
            var person = output.GetAlias <R.Character>("jedi");
        }