I'm working on an app that has two repos; one for a graphql data layer and another for an apollo/react webapp. I'd like to test my grapqhl containers in the apollo/react app using 'mockServer' from the 'graphql-tools' package, which requires a graphql schema. I'm thinking of creating another repo just for a json representation of the graphql schema, pulling that down before tests, then feeding that into 'mockServer'.
Has anyone else had experience with a pattern like this? Most of the apollo testing examples I've seen seem to have the data layer and the ui layer in the same repo.
The main problem I see with this is that the tests will become dependent on the schema repo being updated/available. I think this is probably better than redefining the schema in the apollo/react app just for testing, and think it'd be nice to have tests for containers fail if the graphql schema changes, but I'm curious about other people's opinions/experiences.
Aucun commentaire:
Enregistrer un commentaire