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

Selective "passthrough" of queries to server #47

Open
knownasilya opened this issue Jun 1, 2020 · 2 comments
Open

Selective "passthrough" of queries to server #47

knownasilya opened this issue Jun 1, 2020 · 2 comments

Comments

@knownasilya
Copy link

The issue is that gql is on one endpoint, and if mirage is handling that endpoint how do you do a "passthrough" of select requests to that endpoint.

Maybe if mirage had a passthrough function:

this.passthrough('/api/graphql', (req) => req.body.includes('something'));
this.post('/api/graphql', gql);

Or return this.passAlong() or similar inside the post handler based on logic, where if you return it the request continues to server. cc @samselikoff

@jneurock
Copy link
Contributor

jneurock commented Jun 1, 2020

Mirage does allow you to supply a callback to passthrough. See https://miragejs.com/api/classes/server/#passthrough. I think this should work.

@knownasilya
Copy link
Author

Would love to see this, it would make working with graphql in piecemeal possible.

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

No branches or pull requests

2 participants