Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement autogenerated mocks for GraphQL API from schema #103

Open
halcyondude opened this issue Sep 3, 2022 · 3 comments
Open

Implement autogenerated mocks for GraphQL API from schema #103

halcyondude opened this issue Sep 3, 2022 · 3 comments
Labels
data Data Model, GraphQL e2-days good first issue Good for newcomers help wanted Extra attention is needed

Comments

@halcyondude
Copy link
Collaborator

https://www.graphql-tools.com/docs/mocking#addmockstoschema

Mocking

The strongly-typed nature of a GraphQL API lends itself extremely well to mocking. This is an important part of a GraphQL-First development process, because it enables frontend developers to build out UI components and features without having to wait for a backend implementation.

Even with a backend that is already built, mocking allows you to test your UI without waiting on slow database requests or building out a component harness with a tool like React Storybook.
Default mock example

Let's take a look at how we can mock a GraphQL schema with just one line of code, using the default mocking logic you get out of the box with graphql-tools.

To start, let's grab the schema definition string from the makeExecutableSchema example in the "Generating a schema" article.

@halcyondude halcyondude added good first issue Good for newcomers help wanted Extra attention is needed e2-days data Data Model, GraphQL labels Sep 3, 2022
@solo-daemon
Copy link

i am starting on it .

@firedragonironfist
Copy link

Hello there! I'm interested in contributing to this project and would like to work on this particular issue. Could you please assign me this issue so I can get started? Thank you!

@isinghabhishek
Copy link

Hi, @halcyondude I would like to work on these.
Here is code autogenerated mocks for GraphQL API from schema:
GraphQL API

Please do suggest.

xonx4l added a commit to xonx4l/landscape-graph that referenced this issue Sep 5, 2023
issue-:cncf#103

Signed-off-by: xonx <[email protected]>
halcyondude pushed a commit that referenced this issue Mar 9, 2024
issue-:#103

Signed-off-by: xonx <[email protected]>
halcyondude pushed a commit that referenced this issue Mar 17, 2024
issue-:#103

Signed-off-by: xonx <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Data Model, GraphQL e2-days good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Triage
Development

No branches or pull requests

4 participants