valendres / playwright-msw

A Mock Service Worker API for Playwright
MIT License
168 stars 24 forks source link

Allow configuring multiple graphqlUrl endpoints #63

Open AaronBuxbaum opened 1 year ago

AaronBuxbaum commented 1 year ago

My current system has two GraphQL endpoints which are hit by two different GraphQL clients. This obviously isn't an ideal system, but we are migrating between systems and the graphs have name collisions preventing unification strategies.

Can we enable providing an array of endpoints instead of just a string?

valendres commented 1 year ago

Hey @AaronBuxbaum I'm really busy this weekend, I probably won't have a chance to look at this until next weekend. This feature sounds like a great idea and I'm open to it being introduced. If you're able/willing to tackle this one before I have a chance to, please feel free to submit a PR. 🙂

ypresto commented 4 months ago

For workaround: pass RegExp to graphqlUrl.

createWorkerFixture([...], { graphqlUrl: /\/graphql/ as any })

While its type only accepts string, it actually handles RegExp.