This page contains information useful for testing and creation of queries used in WATcher.
Prerequisites:
Steps
All the following actions are done in Postman.
schema.graphql on your local machinetype Issue {
id: ID!
number: Int!
title: String!
body: String
state: String!
createdAt: String!
updatedAt: String!
url: String!
isDraft: Boolean # Your custom extension
}
Schema tabImport a GraphQL schemaschema.graphql file on your local machineImport as API to save it onlineThe environment section is used to store sensitive data which are only meant for yourself. An example of sensitive data will be your GitHub token.
No environment at the top right corner| Variable | Type | Initial value | Current value |
|---|---|---|---|
| username | default | <YOUR_GITHUB_USERNAME> | <YOUR_GITHUB_USERNAME> |
| token | secret | <YOUR_GITHUB_TOKEN> | <YOUR_GITHUB_TOKEN> |
The queries used in WATcher are created with the use of fragment queries. Fragment query is a reusable unit that allows you to define parts of a query and use them in multiple places. This can be found in graphql > fragments in WATcher and in the Fragments folder in Postman.
Due to limitations in Postman, any fragments used should be added to the query section as well.
In some queries, you will see a cursor argument. The cursor is mainly used for the pagination of queries.
nullIt would be quicker to duplicate an existing query as the authorization and schema will be copied as well.
Authorization tab select Basic Auth as the Auth Type{{username}} and {{token}} in the username and password field respectively. This uses the variables in your environmentQuery tab, you will be able to import your schema, add your query and the relevant variablesQuery tab, the arguments used for the select query can be changed in the Variables section.Query buttonResponse section