Mock Hasura endpoint for unit testing #9819
Unanswered
GiamBoscaro
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Good morning,
I am using Hasura for a project, and using some node services to run some business code that executes queries and mutation on Hasura.
I would like to unit test my APIs and services, but I would like to avoid setting up a whole Hasura and Postgres instances in the pipeline, migrating and seeding the DB etc. to then run the unit test. What I would prefer is just to have some mocked Hasura endpoint that returns some random data.
I am really struggling to find a solution to this. I was extremely happy to find json-graphql-server that does exactly what I need, the problem is that it is generating a GraphQL schema that is fairly different from the one used by Hasura, so all my queries fail.
Do you have a suggestion on how to do this?
Beta Was this translation helpful? Give feedback.
All reactions