Wp-graphql: Add introspection tests.

Created on 23 May 2017  路  3Comments  路  Source: wp-graphql/wp-graphql

Currently, there are no unit tests for testing whether the schema we have designed indeed exists. We should use GraphQL's introspection system to add unit tests proving the schema. Then as the schema is changed the build will fail, alerting to any potential regressions.

Tests help wanted

All 3 comments

With the mutations I'm working on now I've included some tests for the Schema per the Relay spec to make sure the mutations we add adhere to the spec (https://facebook.github.io/relay/graphql/mutations.htm#sec-Introspection)

GraphQL JS also has a "findBreakingChanges" method built in and I've read about some folks integrating CI to check the schema to make sure breaking changes aren't being introduced. (http://joelgriffith.net/setting-up-graphqls-findbreakingchanges-and-eslint-plugin-graphql/)

Would be good to check out for sure.

the Relay spec docs actually give very good detailed introspection queries to use to make sure connections, etc adhere to the spec.

https://facebook.github.io/relay/graphql/objectidentification.htm
https://facebook.github.io/relay/graphql/connections.htm
https://facebook.github.io/relay/graphql/mutations.htm

Closing in favor of #335

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CalebBarnes picture CalebBarnes  路  4Comments

jasonbahl picture jasonbahl  路  4Comments

CodeProKid picture CodeProKid  路  3Comments

cr101 picture cr101  路  3Comments

oleksmir picture oleksmir  路  5Comments