-
-
Save anthonycorbacho/af5cd21817fd206bc89cad2a4a120790 to your computer and use it in GitHub Desktop.
gqlgen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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