Any contributions are grealty appreciated, feel free to open a pull request!
This app provides of the examples of:
- Setting up GraphQL Clients
- Different ember acceptance test techniques for GraphQL
- Linting queries against a schema
The application also includes a built-in GraphQL query client available at http://localhost:4200/api/graph.
The http mock server is made available during tests by
|client||.graphql file||string||generated by ember-data-adapter|
"Relationships" in GraphQL are represented as a field with a list type.
The way the
ember-graphql-adapter generates its query for relationships, based on the model definition,
is not compatible with the github api's use of relay-style pagination. Relay pagination wraps results in the
nodes field, allows arguments for pagination, and more. There is likely manual work needed to map conventions between what the adapter expects and the queries it generates.
ember-graphql-adapter is more closely coupled with the example in its documentation using the graphql gem.
If your relationships aren't coupled in a strong relational way where your graphql types are entities, you might run into some problems.
Login with a github access token at
/login, if it is a valid token then it is set on the session
ember-simple-auth session is set to be "authenticated".
ember-apollo-client authentication links
* Re-generating client instances (
There are outstanding issues for lokka (issue) and graphql-request (issue) that prevent dynamically changing/setting the authorization header. A wrapper service
is setup in the same way for both
graphql-request in which the
client computed property depends on the
client references that were saved in scope could fail to be used if they were setup with an old access token.
Linting queries against a schema with
.eslintrc.js- Setup the
ember-cli-build.js- include an entry if you need a
.graphqlconfignot required but if setup can be used by
eslint-plugin-graphqlfor finding the schema
There is some standardization in the GraphQL community to use
This makes it easier to use with
graphql-cli to generate a schema that is discoverable
by the other tools.
You will need the following things properly installed on your computer.
git clone <repository-url>this repository
Running / Development
- Visit your app at http://localhost:4200.
- Visit your tests at http://localhost:4200/tests.
Make use of the many generators for code, try
ember help generate for more details
ember test --server
npm run lint:js
npm run lint:js -- --fix
ember build --environment production(production)
Specify what it takes to deploy your app.