Last active
July 20, 2018 19:43
-
-
Save jonlundy/1e18a67ed1ccab2edbb7c69a970182cb to your computer and use it in GitHub Desktop.
mutation resolvers
This file contains hidden or 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
type Resolvers interface { | |
CollectionOps_Section(ctx context.Context, obj *CollectionOps, id string) (*SectionOps, error) | |
CollectionOps_addSection(ctx context.Context, obj *CollectionOps, name string) (*Section, error) | |
CollectionOps_removeSection(ctx context.Context, obj *CollectionOps, id string) (*bool, error) | |
Mutation_Collection(ctx context.Context, id string) (*CollectionOps, error) | |
Query_Collection(ctx context.Context, id string) (*Collection, error) | |
SectionOps_addTag(ctx context.Context, obj *SectionOps, value string) (*Tag, error) | |
SectionOps_removeTag(ctx context.Context, obj *SectionOps, value string) (*bool, error) | |
} | |
type ResolverRoot interface { | |
CollectionOps() CollectionOpsResolver | |
Mutation() MutationResolver | |
Query() QueryResolver | |
SectionOps() SectionOpsResolver | |
} | |
type CollectionOpsResolver interface { | |
Section(ctx context.Context, obj *CollectionOps, id string) (*SectionOps, error) | |
AddSection(ctx context.Context, obj *CollectionOps, name string) (*Section, error) | |
RemoveSection(ctx context.Context, obj *CollectionOps, id string) (*bool, error) | |
} | |
type MutationResolver interface { | |
Collection(ctx context.Context, id string) (*CollectionOps, error) | |
} | |
type QueryResolver interface { | |
Collection(ctx context.Context, id string) (*Collection, error) | |
} | |
type SectionOpsResolver interface { | |
AddTag(ctx context.Context, obj *SectionOps, value string) (*Tag, error) | |
RemoveTag(ctx context.Context, obj *SectionOps, value string) (*bool, error) | |
} |
This file contains hidden or 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
models: | |
CollectionOps: | |
model: mutate.CollectionOps | |
fields: | |
Section: | |
resolver: true # force a resolver to be generated | |
addSection: | |
resolver: true | |
removeSection: | |
resolver: true | |
SectionOps: | |
model: mutate.SectionOps | |
fields: | |
addTag: | |
resolver: true | |
removeTag: | |
resolver: true |
This file contains hidden or 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 mutate | |
type CollectionOps struct { | |
ID string | |
} | |
type SectionOps struct { | |
ID string | |
} |
This file contains hidden or 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
type Tag { | |
value: String! | |
} | |
type Section { | |
id: ID! | |
name: String! | |
tags: [Tag!]! | |
tag(value: String!): Tag | |
} | |
type Collection { | |
id: ID! | |
sections: [Section!]! | |
section(id: ID!): Section! | |
} | |
type Query { | |
Collection(id: ID!): Collection | |
} | |
type SectionOps { | |
addTag(value: String!): Tag | |
removeTag(value: String!): Boolean | |
} | |
type CollectionOps { | |
Section(id: ID!): SectionOps | |
addSection(name: String!): Section | |
removeSection(id: ID!): Boolean | |
} | |
type Mutation { | |
Collection(id: ID!): CollectionOps | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment