Skip to content

A simple GraphQL server with queries that allow the easy testing of your GraphQL clients.

License

Notifications You must be signed in to change notification settings

retrodaredevil/graphql-echo

Repository files navigation

graphql-echo

A simple GraphQL server with queries that allow the easy testing of your GraphQL clients.

Motivation: wildmountainfarms/wild-graphql-datasource#10

How this project was made

Design Decisions

  • Language: I knew I wanted to build this with Java or Kotlin, as they are the languages I most enjoy working with. I chose Java because I wanted to experiment with all the feature so of modern Java versions.
  • Framework: Spring is the obvious choice, but what to put on top of it?
    • DGS (by Netflix) - the first working version of GraphQL Echo uses this. I chose it because it had codegen support
      • I chose not to use this because its codegen support was not as good as I had hoped, and DGS feels kind of deprecated in favor of Spring for GraphQL.
      • If I needed a client library, I probably would have chosen to use this and its codegen support
    • Spring for GraphQL - great integration with Spring and well supported

IDE Setup

IntelliJ IDEA

Install plugins:

Building locally

Building the project is as simple as understanding what Gradle tasks you need to call. Typically, you might want to test building the docker image. You can build the docker image like so:

./gradlew bootBuildImage -Pplatform=linux/amd64

Note that you may need to run these commands for multiplatform building:

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multiarch-builder --use --bootstrap --driver docker-container

# Confirm available platforms with:
docker buildx inspect --bootstrap

To combine the images, play around with docker manifest create.

# This command is used as a reference, and not something for you to run exactly as is
# https://docs.docker.com/reference/cli/docker/manifest/#working-with-insecure-registries
# Note --insecure is required whenever any image ref is pointing to a http registry
# Note that each image reference will be referred to via its registry, so you cannot reference local images here
# Note that all image references must be from the same registry
docker manifest create --insecure localhost:5000/asdf/asdf:latest --amend localhost:5000/asdf/asdf:arm   --amend localhost:5000/asdf/asdf:amd

Running Locally

Updating Gradle

https://gradle.org/releases/

# replace 9.0.0 with your desired version
./gradlew wrapper --gradle-version=9.0.0 && ./gradlew wrapper

About

A simple GraphQL server with queries that allow the easy testing of your GraphQL clients.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Languages