Skip to content

Instantly share code, notes, and snippets.

@mugan86
Created September 11, 2019 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mugan86/3796c212760d1cd37b17533f598ef562 to your computer and use it in GitHub Desktop.
Save mugan86/3796c212760d1cd37b17533f598ef562 to your computer and use it in GitHub Desktop.
Add queries to work with queries in GraphQL from Javascript
module.exports = {
apiUrl: 'https://breaking-bad-voting.herokuapp.com/graphql',
queries: {
getCharacters: `{
characters {
id
name
actor
total_episodes
}
}`,
getCharacterWalter: `{
character (id: "1") {
id
name
total_episodes
votes
}
}`,
getSelectCharacter: `
query getCharacter($id: ID!) {
character (id: $id) {
id
name
actor
}
}`
},
mutations: {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment