Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gh 54/johnnyhchen #130

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allBatch.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version" : "2017-02-28",
"operation" : "Scan"
#if( ${context.arguments.count} )
,"limit": $util.toJson($context.arguments.count)
#end
#if( ${context.arguments.nextToken} )
,"nextToken": $util.toJson($context.arguments.nextToken)
#end
}
6 changes: 6 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allBatch.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"batches": $utils.toJson($context.result.items)
#if( ${context.result.nextToken} )
,"nextToken": $util.toJson($context.result.nextToken)
#end
}
10 changes: 10 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allHistory.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version" : "2017-02-28",
"operation" : "Scan"
#if( ${context.arguments.count} )
,"limit": $util.toJson($context.arguments.count)
#end
#if( ${context.arguments.nextToken} )
,"nextToken": $util.toJson($context.arguments.nextToken)
#end
}
6 changes: 6 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allHistory.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"histories": $utils.toJson($context.result.items)
#if( ${context.result.nextToken} )
,"nextToken": $util.toJson($context.result.nextToken)
#end
}
6 changes: 6 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allItems.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"items": $utils.toJson($context.result.items)
#if( ${context.result.nextToken} )
,"nextToken": $util.toJson($context.result.nextToken)
#end
}
10 changes: 10 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allItems.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version" : "2017-02-28",
"operation" : "Scan"
#if( ${context.arguments.count} )
,"limit": $util.toJson($context.arguments.count)
#end
#if( ${context.arguments.nextToken} )
,"nextToken": $util.toJson($context.arguments.nextToken)
#end
}
10 changes: 10 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allMain.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version" : "2017-02-28",
"operation" : "Scan"
#if( ${context.arguments.count} )
,"limit": $util.toJson($context.arguments.count)
#end
#if( ${context.arguments.nextToken} )
,"nextToken": $util.toJson($context.arguments.nextToken)
#end
}
6 changes: 6 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allMain.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"mains": $utils.toJson($context.result.items)
#if( ${context.result.nextToken} )
,"nextToken": $util.toJson($context.result.nextToken)
#end
}
10 changes: 10 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allTags.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version" : "2017-02-28",
"operation" : "Scan"
#if( ${context.arguments.count} )
,"limit": $util.toJson($context.arguments.count)
#end
#if( ${context.arguments.nextToken} )
,"nextToken": $util.toJson($context.arguments.nextToken)
#end
}
6 changes: 6 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.allTags.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tags": $utils.toJson($context.result.items)
#if( ${context.result.nextToken} )
,"nextToken": $util.toJson($context.result.nextToken)
#end
}
7 changes: 7 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.getBatch.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version" : "2017-02-28",
"operation" : "GetItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($ctx.args.id)
}
}
1 change: 1 addition & 0 deletions amplify/backend/api/rms/resolvers/Query.getBatch.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$utils.toJson($context.result)
7 changes: 7 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.getHistory.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version" : "2017-02-28",
"operation" : "GetItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($ctx.args.id)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$utils.toJson($context.result)
7 changes: 7 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.getItems.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version" : "2017-02-28",
"operation" : "GetItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($ctx.args.id)
}
}
1 change: 1 addition & 0 deletions amplify/backend/api/rms/resolvers/Query.getItems.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$utils.toJson($context.result)
7 changes: 7 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.getMain.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version" : "2017-02-28",
"operation" : "GetItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($ctx.args.id)
}
}
1 change: 1 addition & 0 deletions amplify/backend/api/rms/resolvers/Query.getMain.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$utils.toJson($context.result)
7 changes: 7 additions & 0 deletions amplify/backend/api/rms/resolvers/Query.getTags.req.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version" : "2017-02-28",
"operation" : "GetItem",
"key" : {
"id" : $util.dynamodb.toDynamoDBJson($ctx.args.id)
}
}
1 change: 1 addition & 0 deletions amplify/backend/api/rms/resolvers/Query.getTags.res.vtl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$utils.toJson($context.result)
79 changes: 75 additions & 4 deletions amplify/backend/api/rms/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
type Todo @model {
id: ID!
name: String!
description: String
type Query {
allMain(count: Int, nextToken: String): PaginatedMains!
allItems(count: Int, nextToken: String): PaginatedItems!
allBatch(count: Int, nextToken: String): PaginatedBatches!
allTags(count: Int, nextToken: String): PaginatedTags!
allHistory(count: Int, nextToken: String): PaginatedHistories!
}

type Main @model @auth(rules: [{allow: public, operations: [read]}]) {
name: ID!
displayName: String!
description: String
tags: [String!]
items: [String!]
}

type PaginatedMains {
mains: [Main!]!
nextToken: String
}

type Items @model @auth(rules: [{allow: public, operations: [read]}]) {
id: ID!
name: String!
owner: String!
borrower: String!
batch: [String!]
history: [String!]
schedule: [String!]
notes: String
}

type PaginatedItems {
items: [Items!]!
nextToken: String
}

type Batch @model @auth(rules: [{allow: public, operations: [read]}]) {
key: ID!
val: [String!]
}

type PaginatedBatches {
batches: [Batch!]!
nextToken: String
}

type Tags @model @auth(rules: [{allow: public, operations: [read]}]) {
key: ID!
val: [String!]
}

type PaginatedTags {
tags: [Tags!]!
nextToken: String
}

type History @model @auth(rules: [{allow: public, operations: [read]}]) {
key: ID!
name: String!
id: String!
borrower: String!
action: Action!
notes: String
timestamp: Int!
}

type PaginatedHistories {
histories: [History!]!
nextToken: String
}

enum Action {
borrow
return
}
Loading