Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active September 9, 2021 12:09
Show Gist options
  • Save percybolmer/fd7d596f156e954fd92a75d203f0280e to your computer and use it in GitHub Desktop.
Save percybolmer/fd7d596f156e954fd92a75d203f0280e to your computer and use it in GitHub Desktop.
graphql
package schemas
import (
"github.com/graphql-go/graphql"
)
// We can initialize Objects like this unless they need a special resolver
var jobType = graphql.NewObject(graphql.ObjectConfig{
Name: "Job",
Fields: graphql.Fields{
"id": &graphql.Field{
Type: graphql.String,
},
"employeeID": &graphql.Field{
Type: graphql.String,
},
"company": &graphql.Field{
Type: graphql.String,
},
"title": &graphql.Field{
Type: graphql.String,
},
"start": &graphql.Field{
Type: graphql.String,
},
"end": &graphql.Field{
Type: graphql.String,
},
},
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment