-
Notifications
You must be signed in to change notification settings - Fork 2k
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
FEATURE REQUEST: header parameter in query/mutate (apollo-server-testing) #4337
Comments
@dude-awesome - any workaround for this that you have discovered? |
I recently merged an improvement to executeOperation (#4166) which allows you to specify the same integration-specific argument to executeOperation that the normal HTTP path provides to your |
@JoA-MoS the only workaround I have is to pass a static context into my test-server to set my authorization header, so I can see what my resolvers are returning when the user does´nt have the required scopes for a specific graphql operation. like
|
|
How is const result = await server.executeOperation({
http: {
headers: {
// error: ...is not assignable to type 'Headers'
authorization: 'foo',
otherHeader: 'bar'
}
},
query: gqlQuery
}) Would be great if you could provide an example on how to use |
I guess this is a bit more subtle in practice. The headers you pass in However, this doesn't affect the "context argument" passed to your Honestly, I don't think |
Thanks a lot for your very helpful answer. We'll lay out our testing strategy accordingly. |
To test the complete stack in my integrationtests it would be cool if I could also set a header for a query or mutation. (e.g. authorization header to test scopes)
The text was updated successfully, but these errors were encountered: