Skip to content

Instantly share code, notes, and snippets.

@shaheenkdr
Last active October 21, 2017 01:22
Show Gist options
  • Save shaheenkdr/58928c6ccb21dbcf17ff51eae8e3ae70 to your computer and use it in GitHub Desktop.
Save shaheenkdr/58928c6ccb21dbcf17ff51eae8e3ae70 to your computer and use it in GitHub Desktop.
test codes for graphql for Devfest Kochi 21st
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