simple-static-graphql-api

module
v0.0.0-...-81d16f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: Apache-2.0

README

simple_static_graphql_api

Overview

Simple test application for GraphQL API in Go

Main build

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 than string
  • 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
Other Go
Github Actions
Pact testing
Ruby
UNIX

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL