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
Support an official way to pass a Raw JSON String Query #188
Comments
Hi @RickStrahl! The LINQ-style query for your query would be: var query = new Query()
.Repository(name: "MarkdownMonster", owner: "RickStrahl")
.Object(expression: "master:README.md")
.Cast<Blob>()
.Select(x => x.Text); Running the query as a string using It's definitely something we could/should look into though. |
Great! That worked perfectly. So that solves the immediate problem I have here, but the question in the issue is still at point for whether there could be better support for raw JSON responses. |
Hey @RickStrahl we still think this is a valid desire. 😉 |
👋 Hey Friends, this issue has been automatically marked as |
I'm trying to use the GraphQL API to retrieve content from a specific repository item via the GraphQL API.
I can enter a graphQL query into the explorer and it works:
I've been trying to figure out how to duplicate this behavior using the OctoKit GraphQL API to accomplish the same thing. I've not figured out a way to get the LINQ syntax to represent that query, but it appears that I can also send the text directly to
connection.Run(lcJson)
.However this returns
400 Bad Request
. Checking the request trace I can see the raw JSON is going out to the server and it all looks correct.I would have expected that to work.
I turns out the query syntax needs to be more formal and require top level
{query, variables }
object to make this work so I can get it to work.This actually works to retrieve the raw JSON:
but it's not exactly intuitive.
Ideally I would like to see the API syntax provide the strongly typed equivalent of the raw JSON, but I can't find any examples that work to perform the
... on
syntax. I can drill into the object and get the Id but that's where it ends.In the meantime it might be nice to provide some explicit support for raw Text in the API so as to make it obvious that can be provided and automatically handle at least wrapping up the query and variables.
Something like this perhaps:
The text was updated successfully, but these errors were encountered: