Created
October 2, 2016 10:23
-
-
Save gauravtiwari/226f19ea30583662ac9e4a36cea39d17 to your computer and use it in GitHub Desktop.
A list of queries declared in ruby to execute against given graphql server
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
IndexQuery = API::Client.parse <<-'GRAPHQL' | |
query { | |
root { | |
id, | |
tags, | |
posts(first: 10) { | |
edges { | |
node { | |
id, | |
title, | |
slug, | |
excerpt, | |
voted, | |
user_id, | |
created_at, | |
comments_count, | |
tags, | |
votes_count, | |
user { | |
name, | |
} | |
} | |
} | |
pageInfo { | |
hasNextPage | |
} | |
} | |
} | |
} | |
GRAPHQL | |
ShowQuery = API::Client.parse <<-'GRAPHQL' | |
query($id: ID!) { | |
node(id: $id) { | |
id | |
... on Post { | |
id, | |
title, | |
slug, | |
body, | |
voted, | |
user_id, | |
created_at, | |
comments_count, | |
tags, | |
votes_count, | |
user { | |
name, | |
} | |
comments(first: 10, order: "-id") { | |
edges { | |
node { | |
id, | |
votes_count, | |
voted, | |
id, | |
body, | |
is_owner, | |
votes_count, | |
voted, | |
created_at, | |
user { | |
name, | |
}, | |
} | |
}, | |
pageInfo { | |
hasNextPage | |
} | |
} | |
} | |
} | |
} | |
GRAPHQL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment