Skip to content

Fix docs for GraphQL.NET 3.0.0 release #914

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

Closed
wants to merge 3 commits into from

Conversation

sungam3r
Copy link

@sungam3r
Copy link
Author

@IvanGoncharov @leebyron Could you please review? GraphQL.NET received a long-awaited update to version 3.0.0 and it took a little change in the documentation.

@JVimes
Copy link

JVimes commented Oct 26, 2020

@sungam3r, I believe there are a few issues:

@sungam3r
Copy link
Author

I don't think these changes compile. Try following your documentation as if you were a new user.
изображение

Your changes don't fix the exception in the original issue. See this comment.

😕

Shouldn't this merge request change the source documentation? Did you follow the publishing instructions?

Our own documentation http://graphql-dotnet.github.io is now updated automatically after migrating to GitHub Actions.

@@ -64,13 +71,13 @@ public class Program
}
");

var json = schema.Execute(_ =>
var json = schema.ExecuteAsync(_ =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- var json = schema.ExecuteAsync(
+ var json = await schema.ExecuteAsync(

@joemcbride
Copy link
Contributor

@sungam3r I think it's much more intuitive to use async/await.

@sungam3r
Copy link
Author

OK, changed.

@JVimes
Copy link

JVimes commented Oct 26, 2020

@sungam3r What version are you on? It does not work for me:

image

@Shane32
Copy link

Shane32 commented Oct 26, 2020

You need to import a serialization library as well, such as GraphQL.SystemTextJson, or else pass an implementation of IDocumentWriter to the extension method.

@sungam3r
Copy link
Author

@JVimes
изображение

OK?

@JVimes
Copy link

JVimes commented Oct 27, 2020

@Shane32 and @sunapi386 -- No, GraphQL.SystemTextJson is not part of the hello world code sample! Look for yourself here and here and here. The code sample does not have a using statement to bring in the ExecuteAsync extension method. Did you understand the bug report? The code sample does not work.

@Shane32
Copy link

Shane32 commented Oct 27, 2020

No, GraphQL.SystemTextJson is not part of the hello world code sample! Look for yourself here and here and here. The code sample does not have a using statement to bring in the ExecuteAsync extension method. Did you understand the bug report? The code sample does not work.

You're correct. The documentation is wrong, both in this library, and in the graphql-dotnet project samples, for version 3.0. Keep in mind that unlike version 2.4, the json serialization library has been split off from the main project into separate nuget packages, and you will need one of them to make any practical use of the library - you'd need either GraphQL.SystemTextJson or GraphQL.NewtonsoftJson for a sample as small as the "hello world" sample shown.

In addition to the PR here to fix the sample shown here, we will need a PR in the graphql-dotnet repo to fix the file here which when published will update the documentation here. Thank you for pointing this out to us.

@JVimes
Copy link

JVimes commented Oct 27, 2020

Thank you. I think this will really help.

@ardatan ardatan mentioned this pull request Nov 16, 2020
@orta
Copy link
Member

orta commented Nov 18, 2020

I'm going to close this PR as these changes were manually merged upstream by @ardatan in #936 - thanks for updating the list.

Note: We now have markdown files which allow for longer descriptions on the new code page: https://graphql.org/code/ - so it'd be awesome if you added some code samples etc to help any project on the page shine.

@orta orta closed this Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants