Created
May 23, 2017 06:21
-
-
Save florent37/84ae33fa2c0257ac13faa7c8aad06b66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HEADER : Content-Type:application/graphql | |
graphQl | |
.query("todos { title }") | |
.cast(Data.class) | |
.enqueue(new Callback<Data>(){ | |
public void onResponse(Data data){ | |
} | |
}); | |
graphQl | |
.query("todos { title }") | |
.cast(Data.class) | |
.rx() | |
.subscribe(data -> {}); | |
graphQl | |
.mutation("add (title: "@title") { id, title }") | |
.cast(Data.class) | |
.query("title", this.title) | |
.rx() | |
.subscribe(data -> {}); | |
graphQl | |
.query("query HeroNameAndFriends($episode: Episode) { | |
hero(episode: $episode) { | |
name | |
friends { | |
name | |
} | |
} | |
}") | |
.cast(Data.class) | |
.variable(" | |
{ | |
"episode": "@EPISODE" | |
} | |
") | |
.rx() | |
.subscribe(data -> {}); | |
@Fragment | |
@Query("todos { title }") | |
public Observable<Data> getTodos(); | |
$ curl -XPOST -H "Content-Type:application/graphql" -d 'mutation { add (title: "Clean garage") { id, title } }' http://localhost:8080 | |
@Mutation("add (title: "@title") { id, title }") | |
public Observable<> cleanGarage(@Query("title") String title); | |
@GraphQlMethod("query") | |
public Observable<> | |
@Query(" | |
query HeroNameAndFriends($episode: Episode) { | |
hero(episode: $episode) { | |
name | |
friends { | |
name | |
} | |
} | |
} | |
") | |
@Variable(" | |
{ | |
"episode": "@EPISODE" | |
} | |
") | |
public Observable<Data> heroNameAndFriends(@Query("EPISODE") String episode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment