Last active
October 21, 2017 01:22
-
-
Save shaheenkdr/58928c6ccb21dbcf17ff51eae8e3ae70 to your computer and use it in GitHub Desktop.
test codes for graphql for Devfest Kochi 21st
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
OPERATION | |
========================== | |
query foo | |
{ | |
allTrips | |
{ | |
id | |
title | |
} | |
} | |
query bar | |
{ | |
allTrips | |
{ | |
title | |
priority | |
} | |
} | |
ARGUMENTS & VARIABLES | |
============================ | |
query find | |
{ | |
findTrips(searchFor: "ca") | |
{ | |
id title startTime priority duration | |
} | |
} | |
query find($search: String!) | |
{ | |
findTrips(searchFor: $search) | |
{ | |
id title startTime priority duration | |
} | |
} | |
{ | |
"search": "ca" | |
} | |
MUTATION & OBJECTS | |
========================== | |
mutation createTrip($trip: TripInput!) | |
{ | |
createTrip(trip: $trip) | |
{ | |
id | |
} | |
} | |
{ | |
"trip": | |
{ | |
"startTime": "2017-05-03", | |
"title": "A test trip", | |
"priority": "LOW", | |
"duration": 86400 | |
} | |
} | |
============================= | |
LOCAL HOST : http://10.0.2.2:4000/0.1/graphql/ | |
============================ | |
Schema Download: | |
apollo-codegen download-schema https://graphql-demo.commonsware.com/0.2/graphql | |
--output src/main/graphql/com/commonsware/graphql/trips/api/schema.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment