Skip to content

Getting Started tutorial #1

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 18 commits into from
Closed

Getting Started tutorial #1

wants to merge 18 commits into from

Conversation

dondonz
Copy link
Contributor

@dondonz dondonz commented Jan 15, 2023

Hello @rstoyanchev and @bclozel! Here's my first draft of the Getting Started guide for Spring for GraphQL.

  • I've remixed the GraphQL Java tutorial, and placed more emphasis on Spring for GraphQL. I've cut GraphQL Java-specific paragraphs
  • I've added the sample application code, updated to Java 17 and Spring Boot 3.x
  • I followed adoc formatting in other Spring guides, including pulling in common templates. Let me know if there are other Spring tutorial conventions I should be aware of
  • Feel free to comment and edit as you like!

I have a question about the testing section. What sort of test would you like to focus on? Did you want to demonstrate an application test or an end-to-end test including testing HTTP? I thought it would be good to show off at least one of the Spring for GraphQL test helpers, rather than having a plain unit test. Whatever we decide on, I'll add this in.

Also, what's the best way to link to images? Should I link to the GitHub raw link in this repository, or should it be hosted elsewhere? I have a single image to show the GraphiQL playground with the query and response.

cc @andimarek @bbakerman

Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

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

Thanks very much for writing this guide. Looks great for a start!! I've made a few editing comments as suggestions for improvement. Feel free to incorporate as is or adjust them a bit in case I deviated from the original intent too much.

Besides that, I think the structure should mirror that of other guides, with complete and initial sub-directories. So what is currently the graphql-server sub-directory becomes complete. I'll ask @bclozel for a second opinion on this but it seems like it should match other Getting Started guides, e.g. gs-rest-service.

Also @bclozel we should probably rename the project to gs-graphql-server, but let's finish with the PR first.

@rstoyanchev
Copy link
Contributor

What sort of test would you like to focus on?

I think show an @GraphQlTest slice test. That's a focused test on a single controller that makes use of subset of Spring Boot's auto-configuraiton. It's also the first example in the Boot documentation on testing support. We can also mention there are more options including full end-to-end integration tests with a running refer and refer to that section, and/or also link to the section in the Spring GraphQL reference on testing.

Also, what's the best way to link to images? Should I link to the GitHub raw link in this repository, or should it be hosted elsewhere? I have a single image to show the GraphiQL playground with the query and response.

I don't actually know. @Buzzardo, any suggestions?

@Buzzardo
Copy link
Contributor

It's generally a good idea to link to the same repository, because we can control that location. Really, though, any location will do, so long as the image isn't likely to go away.

@dondonz
Copy link
Contributor Author

dondonz commented Jan 20, 2023

Thanks very much for writing this guide. Looks great for a start!! I've made a few editing comments as suggestions for improvement. Feel free to incorporate as is or adjust them a bit in case I deviated from the original intent too much.

I want this guide to sound like we all wrote it together so thanks for the comments!

dondonz and others added 16 commits January 22, 2023 15:15
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
Co-authored-by: Rossen Stoyanchev <rstoyanchev@users.noreply.github.com>
@dondonz dondonz requested a review from rstoyanchev January 22, 2023 09:37
@dondonz
Copy link
Contributor Author

dondonz commented Jan 22, 2023

Hi @rstoyanchev I've put through all your suggestions. I'm ready for another review.

  • I've added the controller slice test and explanation
  • Accepted all wording changes - they were great!
  • Renamed the existing code folder to complete
  • Created a new starter code folder initial

Feel free to comment on the testing section.

Additionally, could I add author credit to the tutorial? As this tutorial is based off the GraphQL Java tutorial, I would like to add @bbakerman and @andimarek as co-authors.

@bclozel bclozel self-assigned this Jan 26, 2023
@bclozel
Copy link
Contributor

bclozel commented Jan 26, 2023

I've just merged this PR with a few additional changes (including the author credit suggested by @dondonz ). Thanks!

@bclozel bclozel closed this Jan 26, 2023
@dondonz
Copy link
Contributor Author

dondonz commented Jan 26, 2023

Thanks @bclozel and @rstoyanchev ! It looks great https://spring.io/guides/gs/graphql-server/

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants