-
Hi, I'm trying to call Octopus Energy's GraphQL api using LinqPad, as so:
the result I get is "Must provide query string." which is correct given the generated request Uri I must be doing something obviously wrong. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
Which GraphQL nuget package(s) and version(s) are you using ? |
Beta Was this translation helpful? Give feedback.
-
@Shane32 Any ideas? Could you try that code in LinqPad. It won't work without an api key but you should at least get a different error if it's working. |
Beta Was this translation helpful? Give feedback.
-
Well, I support the GraphQL and GraphQL.Server repos, not the GraphQL.Client repo. Nor do I use this package in any of my own projects. And LinqPad 8 free edition doesn't allow me to import NuGet packages. I don't see anything obviously wrong here. Maybe if you want to refactor into a console app, I could take a look. It should not be hard to diagnose. Octopus Energy themselves provide a GraphiQL interface here: https://api.octopus.energy/v1/graphql Perhaps @rose-a can give you a few pointers. |
Beta Was this translation helpful? Give feedback.
-
I tried again with a console app. Same result. @rose-a any idea what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
-
Ok I've got further by
I also note that your example client app fails with an exception |
Beta Was this translation helpful? Give feedback.
-
The solution in the end was to add a trailing / to the URL |
Beta Was this translation helpful? Give feedback.
Ok well that’s due to bad documentation on their part then. Technically the two urls are different - the server can implement different responses whether or not there’s a slash at the end. Most web servers automatically compensate. Here they host GraphiQL at the url without a slash and the GraphQL server at the address with a slash it would seem. At least that’s my best guess without personally testing it.