diff --git a/blog/2021-02-12-spec-releases-are-not-important.md b/blog/2021-02-12-spec-releases-are-not-important.md
index 5ab7e2b1..c0595c12 100644
--- a/blog/2021-02-12-spec-releases-are-not-important.md
+++ b/blog/2021-02-12-spec-releases-are-not-important.md
@@ -50,5 +50,3 @@ It is better to think about certain features you want to discuss instead referri
# Feedback or questions
We use [GitHub Discussions](https://github.com/graphql-java/graphql-java/discussions) for general feedback and questions.
-
-You can also contact us on Twitter: [@graphql_java](https://twitter.com/graphql_java)
diff --git a/blog/2021-08-03-17-released-and-lts.md b/blog/2021-08-03-17-released-and-lts.md
index 32051409..2d1d8374 100644
--- a/blog/2021-08-03-17-released-and-lts.md
+++ b/blog/2021-08-03-17-released-and-lts.md
@@ -17,5 +17,5 @@ Going forward we decided to no offer any LTS versions anymore. We will only acti
the latest version (currently 17). We may backport critical bugfixes, but we are not committed to it.
If this is a huge problem for you or your Company and you are willing to help us with maintaining a LTS
-version you can reach us at Twitter [GraphQL Java](https://twitter.com/graphql_java) or per mail at
+version you can reach us via email at
hello at graphql-java dot com.
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 5d8c6fed..05db8c8f 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -103,10 +103,6 @@ const config = {
label: 'GitHub Discussions',
href: 'https://github.com/graphql-java/graphql-java/discussions',
},
- {
- label: 'Twitter',
- href: 'https://twitter.com/graphql_java',
- },
],
},
{
diff --git a/src/components/HomepageFeatures.js b/src/components/HomepageFeatures.js
deleted file mode 100644
index c2eadc3e..00000000
--- a/src/components/HomepageFeatures.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import React from 'react';
-import clsx from 'clsx';
-import styles from './HomepageFeatures.module.css';
-
-const FeatureList = [
- {
- title: 'Easy to Use',
- // TODO: image
- Svg: require('../../static/img/undraw_docusaurus_mountain.svg').default,
- // TODO: description
- description: (
- <>
- Docusaurus was designed from the ground up to be easily installed and
- used to get your website up and running quickly.
- >
- ),
- },
- {
- title: 'Focus on What Matters',
- // TODO: image
- Svg: require('../../static/img/undraw_docusaurus_tree.svg').default,
- // TODO: description
- description: (
- <>
- Docusaurus lets you focus on your docs, and we'll do the chores. Go
- ahead and move your docs into the docs directory.
- >
- ),
- },
- {
- title: 'Battle tested',
- // TODO: image
- Svg: require('../../static/img/undraw_docusaurus_react.svg').default,
- // TODO: description
- description: (
- <>
- Extend or customize your website layout by reusing React. Docusaurus can
- be extended while reusing the same header and footer.
- >
- ),
- },
-];
-
-function Feature({Svg, title, description}) {
- return (
-
-
- );
-}
diff --git a/src/components/HomepageFeatures.module.css b/src/components/HomepageFeatures.module.css
deleted file mode 100644
index b248eb2e..00000000
--- a/src/components/HomepageFeatures.module.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.features {
- display: flex;
- align-items: center;
- padding: 2rem 0;
- width: 100%;
-}
-
-.featureSvg {
- height: 200px;
- width: 200px;
-}
diff --git a/src/pages/about.md b/src/pages/about.md
index 267d3b68..7b7bf3ec 100644
--- a/src/pages/about.md
+++ b/src/pages/about.md
@@ -6,8 +6,6 @@ hide_table_of_contents: true
# About
-The GraphQL Java project is run by [Andreas Marek](https://twitter.com/andimarek) and [Brad Baker](https://github.com/bbakerman).
+The GraphQL Java project is run by [Andreas Marek](https://github.com/andimarek), [Brad Baker](https://github.com/bbakerman), and [Donna Zhou](https://github.com/dondonz).
Andreas Marek is responsible for the content of this website.
-
-You can also follow [GraphQL Java on Twitter](https://twitter.com/graphql_java).
diff --git a/src/pages/index.js b/src/pages/index.js
index c98f619d..83f3b54e 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -4,7 +4,6 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
-import HomepageFeatures from '../components/HomepageFeatures';
function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
@@ -32,9 +31,6 @@ export default function Home() {
title={`Hello from ${siteConfig.title}`}
description="GraphQL Java home page">
- {/**/}
- {/**/}
- {/**/}
);
}
diff --git a/src/pages/tutorials/getting-started-with-spring-boot.md b/src/pages/tutorials/getting-started-with-spring-boot.md
index aec1212c..e37d73bc 100644
--- a/src/pages/tutorials/getting-started-with-spring-boot.md
+++ b/src/pages/tutorials/getting-started-with-spring-boot.md
@@ -5,7 +5,7 @@ id: tutorial-getting-started
---
# Getting started with Spring for GraphQL
-In this tutorial, you will create a GraphQL server in Java using [Spring for GraphQL](https://docs.spring.io/spring-graphql/docs/current/reference/html/). It requires a little Spring and Java knowledge. While we give a brief introduction to GraphQL, the focus of this tutorial is developing a GraphQL server in Java.
+In this tutorial, you will create a GraphQL server in Java using [Spring for GraphQL](https://docs.spring.io/spring-graphql/reference/) in 3 minutes. It requires a little Spring and Java knowledge. While we give a brief introduction to GraphQL, the focus of this tutorial is developing a GraphQL server in Java.
If you're looking to learn more after this tutorial, we (the maintainers) have written a book! [**GraphQL with Java and Spring**](https://leanpub.com/graphql-java) includes everything you need to know to build a production ready GraphQL service with Spring for GraphQL, the official Spring integration built on top of the GraphQL Java engine. It's available on [Leanpub](https://leanpub.com/graphql-java) and [Amazon](https://www.amazon.com/GraphQL-Java-Spring-Andreas-Marek-ebook/dp/B0C96ZYWPF/).
@@ -85,7 +85,7 @@ We've barely scratched the surface of what's possible with GraphQL. Further info
[GraphQL Java](https://www.graphql-java.com) is the Java (server) implementation for GraphQL.
There are several repositories in the GraphQL Java Github org. The most important one is the [GraphQL Java Engine](https://github.com/graphql-java/graphql-java) which is the basis for everything else.
-The GraphQL Java Engine is only concerned with executing queries. It doesn't deal with any HTTP or JSON related topics. For these aspects, we will use [Spring for GraphQL](https://docs.spring.io/spring-graphql/docs/current/reference/html/) which takes care of exposing our API via Spring Boot over HTTP.
+The GraphQL Java Engine is only concerned with executing queries. It doesn't deal with any HTTP or JSON related topics. For these aspects, we will use [Spring for GraphQL](https://docs.spring.io/spring-graphql/reference/) which takes care of exposing our API via Spring Boot over HTTP.
The main steps of creating a GraphQL Java server are:
@@ -104,17 +104,17 @@ The easiest way to create a Spring Boot app is to use the [Spring Initializr](ht
Select:
- Gradle Project
-- Java
-- Spring Boot 2.7.x
+- Spring Boot 3
+- Java 17 or higher
For the project metadata, use:
-- Group: `com.graphql-java.tutorial`
+- Group: `com.graphqljava.tutorial`
- Artifact: `bookDetails`
-For dependencies, use:
+For dependencies, select:
-- Spring Web
+- Spring Web, and
- Spring for GraphQL
Then click on `Generate` for a ready to use Spring Boot app.
@@ -124,8 +124,6 @@ Spring for GraphQL adds many useful features including loading schema files, ini
## Schema
-Create a directory `src/main/resources/graphql`.
-
Add a new file `schema.graphqls` to `src/main/resources/graphql` with the following content:
```graphql
@@ -160,81 +158,68 @@ It is very important to understand that GraphQL doesn't dictate in any way where
This is the power of GraphQL: it can come from a static in-memory list, from a database or an external service.
### Create the Book class
+
Add the following to `bookDetails/Book.java`
```java
-public class Book {
-
- private String id;
- private String name;
- private int pageCount;
- private String authorId;
-
- public Book(String id, String name, int pageCount, String authorId) {
- this.id = id;
- this.name = name;
- this.pageCount = pageCount;
- this.authorId = authorId;
- }
-
+package com.graphqljava.tutorial.bookDetails;
+
+import java.util.Arrays;
+import java.util.List;
+
+record Book(String id, String name, int pageCount, String authorId) {
+
private static List books = Arrays.asList(
- new Book("book-1", "Harry Potter and the Philosopher's Stone", 223, "author-1"),
- new Book("book-2", "Moby Dick", 635, "author-2"),
- new Book("book-3", "Interview with the vampire", 371, "author-3")
+ new Book("book-1", "Harry Potter and the Philosopher's Stone", 223, "author-1"),
+ new Book("book-2", "Moby Dick", 635, "author-2"),
+ new Book("book-3", "Interview with the vampire", 371, "author-3")
);
public static Book getById(String id) {
- return books.stream().filter(book -> book.getId().equals(id)).findFirst().orElse(null);
- }
-
- public String getId() {
- return id;
+ return books.stream().filter(book -> book.id().equals(id)).findFirst().orElse(null);
}
- public String getAuthorId() {
- return authorId;
- }
}
```
### Create the Author class
Add the following to `bookDetails/Author.java`
```java
-public class Author {
+package com.graphqljava.tutorial.bookDetails;
- private String id;
- private String firstName;
- private String lastName;
+import java.util.Arrays;
+import java.util.List;
- public Author(String id, String firstName, String lastName) {
- this.id = id;
- this.firstName = firstName;
- this.lastName = lastName;
- }
+record Author(String id, String firstName, String lastName) {
private static List authors = Arrays.asList(
- new Author("author-1", "Joanne", "Rowling"),
- new Author("author-2", "Herman", "Melville"),
- new Author("author-3", "Anne", "Rice")
+ new Author("author-1", "Joanne", "Rowling"),
+ new Author("author-2", "Herman", "Melville"),
+ new Author("author-3", "Anne", "Rice")
);
public static Author getById(String id) {
- return authors.stream().filter(author -> author.getId().equals(id)).findFirst().orElse(null);
+ return authors.stream().filter(author -> author.id().equals(id)).findFirst().orElse(null);
}
- public String getId() {
- return id;
- }
}
```
## Adding code to fetch data
-Spring for GraphQL provides an [annotation-based programming model](https://docs.spring.io/spring-graphql/docs/current/reference/html/#controllers) to declare handler methods to fetch the data for specific GraphQL fields.
+Spring for GraphQL provides an [annotation-based programming model](https://docs.spring.io/spring-graphql/reference/controllers.html) to declare handler methods to fetch the data for specific GraphQL fields.
Add the following to `bookDetails/BookController.java`
```java
+package com.graphqljava.tutorial.bookDetails;
+
+import org.springframework.graphql.data.method.annotation.Argument;
+import org.springframework.graphql.data.method.annotation.QueryMapping;
+import org.springframework.graphql.data.method.annotation.SchemaMapping;
+import org.springframework.stereotype.Controller;
+
@Controller
-public class BookController {
+class BookController {
+
@QueryMapping
public Book bookById(@Argument String id) {
return Book.getById(id);
@@ -242,10 +227,12 @@ public class BookController {
@SchemaMapping
public Author author(Book book) {
- return Author.getById(book.getAuthorId());
+ return Author.getById(book.authorId());
}
+
}
```
+
The `@QueryMapping` annotation binds this method to a query, a field under the Query type.
The query field is then determined from the method name, `bookById`. It could also be declared on the annotation.
Spring for GraphQL uses `RuntimeWiring.Builder` to register the handler method as a `graphql.schema.DataFetcher` for the query field `bookById`.
@@ -259,7 +246,7 @@ The `@SchemaMapping` annotation maps a handler method to a field in the GraphQL
The field name defaults to the method name, and the type name defaults to the simple class name of the source/parent object injected into the method. In this example, the field defaults to `author` and the type defaults to `Book`.
The type and field can be specified in the annotation.
-For more, see the [documentation for the Spring for GraphQL annotated controller feature](https://docs.spring.io/spring-graphql/docs/current/reference/html/#controllers).
+For more, see the [documentation for the Spring for GraphQL annotated controller feature](https://docs.spring.io/spring-graphql/reference/controllers.html).
That's all the code we need! Let's run our first query.
@@ -270,9 +257,10 @@ GraphiQL is a useful visual interface for writing and executing queries, and muc
```
spring.graphql.graphiql.enabled=true
-spring.graphql.graphiql.path=/graphiql
```
+This will enable GraphiQL at the path `/graphiql` by default. You can change this path by configuring `spring.graphql.graphiql.path`.
+
### Boot the application
Start your Spring application.
@@ -304,7 +292,7 @@ With the help of Spring for GraphQL features, we were able to achieve this with
## Further reading
### Book
-If you want to learn more, we have written a book! [**GraphQL with Java and Spring**](https://leanpub.com/graphql-java) includes everything you need to know to build a production ready GraphQL service with Spring for GraphQL and GraphQL Java.
+If you want to learn more, we (the maintainers) have written a book! [**GraphQL with Java and Spring**](https://leanpub.com/graphql-java) includes everything you need to know to build a production ready GraphQL service with Spring for GraphQL and GraphQL Java.
Learn first-hand from the founder of GraphQL Java and co-author of Spring for GraphQL. The book is suitable for beginners and also includes advanced topics for intermediate readers. The book is available on [Leanpub](https://leanpub.com/graphql-java) and [Amazon](https://www.amazon.com/GraphQL-Java-Spring-Andreas-Marek-ebook/dp/B0C96ZYWPF/).
@@ -315,7 +303,7 @@ The source code for this tutorial can be found on [GitHub](https://github.com/gr
Read the GraphQL Java [documentation](https://www.graphql-java.com/documentation/getting-started).
### More Spring for GraphQL examples
-See samples in the [1.0.x branch](https://github.com/spring-projects/spring-graphql/tree/1.0.x/samples), which will soon be [moved into](https://github.com/spring-projects/spring-graphql/issues/208) a separate repository.
+See the [Spring for GraphQL documentation for more samples](https://docs.spring.io/spring-graphql/reference/samples.html).
### GitHub Discussions
We also use [GitHub Discussions](https://github.com/graphql-java/graphql-java/discussions) for any questions or problems.
\ No newline at end of file
diff --git a/static/img/docusaurus.png b/static/img/docusaurus.png
deleted file mode 100644
index f458149e..00000000
Binary files a/static/img/docusaurus.png and /dev/null differ
diff --git a/static/img/graphiQL.png b/static/img/graphiQL.png
index 1f22d9f4..73314990 100644
Binary files a/static/img/graphiQL.png and b/static/img/graphiQL.png differ
diff --git a/static/img/logo.svg b/static/img/logo.svg
deleted file mode 100644
index 9db6d0d0..00000000
--- a/static/img/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/static/img/tutorial/docsVersionDropdown.png b/static/img/tutorial/docsVersionDropdown.png
deleted file mode 100644
index ff1cbe68..00000000
Binary files a/static/img/tutorial/docsVersionDropdown.png and /dev/null differ
diff --git a/static/img/tutorial/localeDropdown.png b/static/img/tutorial/localeDropdown.png
deleted file mode 100644
index d7163f96..00000000
Binary files a/static/img/tutorial/localeDropdown.png and /dev/null differ
diff --git a/static/img/undraw_docusaurus_mountain.svg b/static/img/undraw_docusaurus_mountain.svg
deleted file mode 100644
index 431cef2f..00000000
--- a/static/img/undraw_docusaurus_mountain.svg
+++ /dev/null
@@ -1,170 +0,0 @@
-
diff --git a/static/img/undraw_docusaurus_react.svg b/static/img/undraw_docusaurus_react.svg
deleted file mode 100644
index e4170504..00000000
--- a/static/img/undraw_docusaurus_react.svg
+++ /dev/null
@@ -1,169 +0,0 @@
-
diff --git a/static/img/undraw_docusaurus_tree.svg b/static/img/undraw_docusaurus_tree.svg
deleted file mode 100644
index a05cc03d..00000000
--- a/static/img/undraw_docusaurus_tree.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file