I have an Apollo Graphql server up and running. I can make queries using the graphiql just fine.
BUT: When I try to make the same queries using cross-fetch OR Postman, i get no end of troubles.
Postman shows the following error from the server:
{"errors":[{"message":"Expected type String, found String.","locations":[{"line":1,"column":35}]},{"message":"Expected type String, found String.","locations":[{"line":1,"column":52}]},{"message":"Expected type String, found String.","locations":[{"line":1,"column":69}]}]}
The request was this ( copied right from server console.log statement ):
{"query":" { login(RQToken: String, username:String, password:String) { RQToken } } ","variables":{"username":"aoeu","password":"aoeu"}}
What is sending me a little crazy is I get three errors that all say "Expected type String, found String".
WHAT? WHAT ? it wants a string, it got a string. It tells me this is an error.
What I have done so far:
Thank you in advance.
Robert
If that's the actual query, then it's not quite formatted correctly. You probably want something more like this -
query getLogin($username: String, $password: String){
login(username: $username, password: $password) { RQToken }
}
And then still passing username and password variables as you've shown in your example
Eugene,
thanks so much for answering. I will give it a try and let you know.. Best, Robert
@eugene1g Thank you!
What is sending me a little crazy is I get three errors that all say "Expected type String, found String".
WHAT? WHAT ? it wants a string, it got a string.
Thank goodness someone found this as humorously frustrating as I have.
Most helpful comment
Thank goodness someone found this as humorously frustrating as I have.