Skip to content

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

Open
neil585456525 wants to merge 1 commit intovalendres:mainfrom
neil585456525:main
Open

test: add test case to ensure it works with msw graphql link#66
neil585456525 wants to merge 1 commit intovalendres:mainfrom
neil585456525:main

Conversation

@neil585456525
Copy link
Copy Markdown

@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