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

test: add test case to ensure it works with msw graphql link #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neil585456525
Copy link

@neil585456525 neil585456525 commented Apr 28, 2023

Hi, regarding issue#63
I would like to propose an update to the library about supporting multiple endpoints for GraphQL use cases.

After testing the official msw feature graphql.link, I discovered that this library can already work with this API. As a result, I have added an integration test and made minor UI adjustments to the example settings-form page to provide an example and testing for this use case.

Related source code in msw:

  • new graphql handler with endpoint url (code)
  • predict request if match current graphql handler (code)

For other considerations like register & unreqister routes based on the path, so far msw set the edpoint property in graphql handler as private. We can not directly access to this attribute (or we just use it and ignore the ts error).
Another possible but hacky way is getting it from parsing header.

Please let me know that which solution you prefer or if you have any other advises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant