-
Notifications
You must be signed in to change notification settings - Fork 17
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
Can we pass Authentication in header? #15
Comments
I also have same problem, used django.auth for authentication of users in App and I want to test Graphql from client side(used Apollo Client) with Authentication header. |
Yes:
|
Having a little trouble with this actually. My header has a hypen in it, and so I tried something along the lines of var auth_header = {}
auth_header["hypen-header"] = "somevalue";
var test = tester({
url: ...
...auth_header
}) And that does not seem to be working. Any workarounds you can think of, @msmfsd ? |
@sjakati98 Did you get this to work? Or how did you do? |
@Ingelhag @sjakati98 I got it working - see my comment above ^ - make sure you quit your dev server before running tests |
@sjakati98 did you try camel case? |
How I use |
Hi Guys, For anyone who stumbled on this problem, and especially for @msmfsd @sri102info @pramodj009 @nsourov, if you need to pass in an authorization header then you could probably do it as @msmfsd mentioned, however it did not actually work in my case. Instead to pass in ANY custom header you should actually install this package graphql-tester-options. Instead of installing graphql-tester. You can now send in the graphql query as the 1st argument, and then as the second argument just send in an object defining your custom header. Job done. Here is an example where I send in the custom header x-mock:
Cheers! |
We need to test our API end point which uses Authentication in header, whereas the tester function will take url, server, method and contenttype.
Can we have Authentication in tester function?
The text was updated successfully, but these errors were encountered: