playwright-msw icon indicating copy to clipboard operation
playwright-msw copied to clipboard

Allow configuring multiple graphqlUrl endpoints

Open AaronBuxbaum opened this issue 1 year ago • 2 comments

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?

AaronBuxbaum avatar Mar 13 '23 21:03 AaronBuxbaum

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. 🙂

valendres avatar Mar 20 '23 01:03 valendres

For workaround: pass RegExp to graphqlUrl.

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

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

ypresto avatar Jul 10 '24 12:07 ypresto