../gql-interfaces-snippet
Example of querying multiple data types from a list with graphql interfaces
Clone with
git clone git://git.awl.red/neallred/gql-interfaces-snippet

gql-interfaces-snippet📎

Brief example showing how to use interfaces and fetch lists of data with multiple types

  • Run server with go run server.go
  • Open a browser tab to http://localhost:8080
  • Query the following snippet:
{
  inventory {
    SN
    MAC
    ... on HardDrive {
      Name
      Capacity
    }
    ... on ComputeNode {
      Name
    }
  }
}
README.md 11 months ago
go.mod 11 months ago
go.sum 11 months ago
gqlgen.yml 11 months ago
graph
generated.go 11 months ago
model
models_gen.go 11 months ago
resolver.go 11 months ago
schema.graphqls 11 months ago
schema.resolvers.go 11 months ago
str.go 11 months ago
server.go 11 months ago
tools.go 11 months ago