graphql-python / graphql-python/gql-next

Good support for mocking responses, tests

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
78
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I think this should be high in the roadmap:
Make it easy/fun for application writers to write mock gql responses, to support their tests.

This includes:
- Check the mock used in the test matches the query & schema used.
- Allow a mocked response to contain "don't-care" values (which the test writer knows aren't important for the specific test) and [sentinel](https://docs.python.org/3/library/unittest.mock.html#unittest.mock.sentinel) values (which the author will want to check for identity).
- Allow a basic mocked response to be written for a test class, and then 'patched" in place for each test with specific changes.
- Maybe automagically generate a mocked response, à la https://github.com/marak/Faker.js/ ?

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by reviewing the repository's existing GraphQL client tests and any response-mocking support, then map the requested behaviors to testable interfaces. Done means mocks can be checked against queries and schemas, support don't-care and sentinel values, allow per-test patching, and clarify whether automatic generation is included.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.