Gisle Aune
5 years ago
8 changed files with 149 additions and 8 deletions
-
36graph/resolvers/mutation.resolvers.go
-
32graph/resolvers/query.resolvers.go
-
57graph/schema/item.gql
-
4graph/schema/mutation.gql
-
17graph/schema/query.gql
-
7graph/schema/scalars.gql
-
3migrations/mysql/20200406110301_create_table_item.sql
-
1models/issueitem.go
@ -0,0 +1,57 @@ |
|||||
|
""" |
||||
|
An item that can be required for an issue. |
||||
|
""" |
||||
|
type Item { |
||||
|
"The item's unique ID." |
||||
|
id: String! |
||||
|
"Name of the item." |
||||
|
name: String! |
||||
|
"A description of the item." |
||||
|
description: String! |
||||
|
"Item tags." |
||||
|
tags: [String!]! |
||||
|
"Quantity unit. Usually absent, but otherwise most often 'g' or 'ml'" |
||||
|
quantityUnit: String |
||||
|
"URL for the image, if available." |
||||
|
imageUrl: String |
||||
|
} |
||||
|
|
||||
|
"Filter for the items query." |
||||
|
input ItemFilter { |
||||
|
"Get these item IDs. Mostly used internally." |
||||
|
itemIds: [String!] |
||||
|
"Limit to items with any of the following tags." |
||||
|
tags: [String!] |
||||
|
} |
||||
|
|
||||
|
"Input for the createItem mutation." |
||||
|
input ItemCreateInput { |
||||
|
"Put a name on it." |
||||
|
name: String! |
||||
|
"Describe it for me." |
||||
|
description: String! |
||||
|
"Add a tag or a few" |
||||
|
tags: [String!]! |
||||
|
"Optional: Quanity unit." |
||||
|
quantityUnit: String |
||||
|
"Optional: Upload an image." |
||||
|
image: Upload |
||||
|
} |
||||
|
|
||||
|
"Input for the editItem mutation." |
||||
|
input ItemEditInput { |
||||
|
"Update the name." |
||||
|
setName: String |
||||
|
"Update the description." |
||||
|
setDescription: String |
||||
|
"Add new tags. The tags are added after removeTag tags are removed." |
||||
|
addTags: [String] |
||||
|
"Remove existing tags. If a tag exists both here and in addTags, it will not be removed." |
||||
|
removeTags: [String] |
||||
|
"Update quantity unit." |
||||
|
setQuantityUnit: String |
||||
|
"Clear quantity unit." |
||||
|
clearQuantityUnit: Boolean |
||||
|
"Update the image URL with a new image." |
||||
|
updateImage: Upload |
||||
|
} |
@ -1,14 +1,21 @@ |
|||||
type Query { |
type Query { |
||||
"Find issue" |
|
||||
|
"Find issue." |
||||
issue(id: String!): Issue! |
issue(id: String!): Issue! |
||||
"List issues" |
|
||||
|
"List issues." |
||||
issues(filter: IssueFilter): [Issue!]! |
issues(filter: IssueFilter): [Issue!]! |
||||
|
|
||||
"Find project" |
|
||||
|
"Find item." |
||||
|
item(id: String!): Item! |
||||
|
"List items." |
||||
|
items(filter: ItemFilter): [Item!]! |
||||
|
"List item tags." |
||||
|
itemTags: [String!]! |
||||
|
|
||||
|
"Find project." |
||||
project(id: String!): Project! |
project(id: String!): Project! |
||||
"List projects" |
|
||||
|
"List projects." |
||||
projects(filter: ProjectFilter): [Project!]! |
projects(filter: ProjectFilter): [Project!]! |
||||
|
|
||||
"Session checks the user session." |
|
||||
|
"Check the user session." |
||||
session: User |
session: User |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue