Skip to content

Instantly share code, notes, and snippets.

@anthonycorbacho
Last active May 30, 2019 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonycorbacho/af5cd21817fd206bc89cad2a4a120790 to your computer and use it in GitHub Desktop.
Save anthonycorbacho/af5cd21817fd206bc89cad2a4a120790 to your computer and use it in GitHub Desktop.
gqlgen
schema:
- "api/schema.graphql"
exec:
filename: api/server.go
package: api
model:
filename: api/models.go
package: api
resolver:
filename: api/resolver.go
type: Resolver
package api
import (
"context"
) // THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES.
type Resolver struct{}
func (r *Resolver) Query() QueryResolver {
return &queryResolver{r}
}
type queryResolver struct{ *Resolver }
func (r *queryResolver) Employee(ctx context.Context, id string) (*Employee, error) {
panic("not implemented")
}
func (r *queryResolver) Company(ctx context.Context, id string) (*Company, error) {
panic("not implemented")
}
schema {
query: Query
}
type Query {
employee(id:ID!): Employee!
company(id:ID!): Company!
}
" An employee "
type Employee {
" A unique identifier. "
id: ID!
" The name of this person. "
name: String!
" The birth year of the person. "
birthDate: String!
" The companies this person is working at. "
companies: [Company!]!
}
" A Company "
type Company {
" A unique identifier. "
id: ID!
" The name of this company. "
name: String!
" The birth year of the company. "
birthYear: Int
" Employees working at this company "
employees: [Employee!]!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment