# README
simple_static_graphql_api
Overview
Simple test application for GraphQL API in Go
Quickstart
Follow the instructions in docs/pact_testing.md to setup the Pact tools.
Development Notes
Details of how this project was created. You don't need to follow these instructions to get things up and running
Setup
- Created initial module file
go mod init github.com/fionahiklas/simple-static-graphql-api
- Adding dependency
go get github.com/graph-gophers/graphql-go
- Created basic Makefile to be able to run tests and linting
Resolvers
- For string fields which can be nullable (don't have
!
) the type is*string
rather thanstring
- To set pointer to empty string as a return value needs some work as per this post
- It seems that
[SomeGraphQLType!]!
requires a Go slice so*[]*SomeGoStruct
doesn't seem to be correct - Unless you allow struct resolvers (this is mentioned in the docs, TODO: add link) each resolver needs to implement accessors for every field in the GraphQL type
References
GraphQL
- GraphQL implementations for Go
- Go graphQL framework from graph-gophers
- GraphQL by example
- GraphIQL
- Apollo Server Resolvers
- GraphQL Schema
- Serving GraphQL over HTTP
- GraphQL inspector
- GraphQL Playground
- GraphQL schema basics
- Introspection
- GraphQL spec
Other Go
- JMESPath Go implementation
- JMESPath Tutorial
- Converting from arrays of interface
- Trim whitespace
- Listen on random/free port
- Read whole file
- Using go ldflags to set version values
- Decode maps to structs
Github Actions
Pact testing
- Pact testing homepage
- Pact documentation
- Pact testing tutorial
- Pact go workshop
- Pact go implementation
- Pact testing with GraphQL