graphql-kit / graphql-faker

🎲 Mock or extend your GraphQL API with faked data. No coding required.
MIT License
2.68k stars 225 forks source link

Improve handling and retry logic when extending a schema #183

Closed Tehnix closed 2 years ago

Tehnix commented 2 years ago

Description

When extending a schema, the current implementation assumes that the server you are extending is already running and ready. This makes it a bit more tricky to plug in graphql-faker into a development flow, where graphql-faker might be started at the same time as the schema that's being extending, and as such it would currently fail and never become ready.

This PR adds retry handling to keep trying to extend the schema until it succeeds. As an additional feature, this should probably either be behind a CLI flag, or at least the user should be allowed to opt-out of the retry behavior, if they truly do want the current failure mode.

Tehnix commented 2 years ago

Wups, this was meant to first go into my own fork, sorry about that!