maticzav / swift-graphql

A GraphQL client that lets you forget about GraphQL.
https://swift-graphql.com
MIT License
604 stars 68 forks source link

GraphQL: Mock request support for testing #183

Open shaps80 opened 11 months ago

shaps80 commented 11 months ago

@maticzav this is really a question for you to begin with.

I had trouble (as have others) running the tests since we don't seem to be able to get the local server running.

However I wonder why we even need to take that approach? I was thinking making use of URLProtocol would be far simpler and make it easier to run tests, directly from Xcode.

Can you comment on this, as perhaps I'm missing the point here ;)

maticzav commented 11 months ago

Yes!

I am totally for having a mock interface and doing it right.

The way I've done it in the past is hosting a server and then using that but Render became too expensive at one point and I had to shut it down.

shaps80 commented 11 months ago

Yeah, in general, it's a far more involved approach to use a server. I'll take a look into this then. Thanks. Appreciate the feedback a lot