Skip to content

Commit

Permalink
feat: support auto increment
Browse files Browse the repository at this point in the history
merge changes from fork
  • Loading branch information
p5quared committed Sep 18, 2024
2 parents 1f4ac65 + 235b805 commit 7ddef03
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,222 @@ $util.qr($context.args.input.put(\\"stringValue\\", $util.defaultIfNull($ctx.arg
{}"
`;

exports[`DefaultValueModelTransformer: should successfully transform a schema that implies auto-increment 1`] = `
"type TestAutoIncrement {
id: ID!
value: Int
}
input ModelStringInput {
ne: String
eq: String
le: String
lt: String
ge: String
gt: String
contains: String
notContains: String
between: [String]
beginsWith: String
attributeExists: Boolean
attributeType: ModelAttributeTypes
size: ModelSizeInput
}
input ModelIntInput {
ne: Int
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
between: [Int]
attributeExists: Boolean
attributeType: ModelAttributeTypes
}
input ModelFloatInput {
ne: Float
eq: Float
le: Float
lt: Float
ge: Float
gt: Float
between: [Float]
attributeExists: Boolean
attributeType: ModelAttributeTypes
}
input ModelBooleanInput {
ne: Boolean
eq: Boolean
attributeExists: Boolean
attributeType: ModelAttributeTypes
}
input ModelIDInput {
ne: ID
eq: ID
le: ID
lt: ID
ge: ID
gt: ID
contains: ID
notContains: ID
between: [ID]
beginsWith: ID
attributeExists: Boolean
attributeType: ModelAttributeTypes
size: ModelSizeInput
}
input ModelSubscriptionStringInput {
ne: String
eq: String
le: String
lt: String
ge: String
gt: String
contains: String
notContains: String
between: [String]
beginsWith: String
in: [String]
notIn: [String]
}
input ModelSubscriptionIntInput {
ne: Int
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
between: [Int]
in: [Int]
notIn: [Int]
}
input ModelSubscriptionFloatInput {
ne: Float
eq: Float
le: Float
lt: Float
ge: Float
gt: Float
between: [Float]
in: [Float]
notIn: [Float]
}
input ModelSubscriptionBooleanInput {
ne: Boolean
eq: Boolean
}
input ModelSubscriptionIDInput {
ne: ID
eq: ID
le: ID
lt: ID
ge: ID
gt: ID
contains: ID
notContains: ID
between: [ID]
beginsWith: ID
in: [ID]
notIn: [ID]
}
enum ModelAttributeTypes {
binary
binarySet
bool
list
map
number
numberSet
string
stringSet
_null
}
input ModelSizeInput {
ne: Int
eq: Int
le: Int
lt: Int
ge: Int
gt: Int
between: [Int]
}
enum ModelSortDirection {
ASC
DESC
}
type ModelTestAutoIncrementConnection {
items: [TestAutoIncrement]!
nextToken: String
}
input ModelTestAutoIncrementFilterInput {
id: ModelIDInput
value: ModelIntInput
and: [ModelTestAutoIncrementFilterInput]
or: [ModelTestAutoIncrementFilterInput]
not: ModelTestAutoIncrementFilterInput
}
type Query {
getTestAutoIncrement(id: ID!): TestAutoIncrement
listTestAutoIncrements(id: ID, filter: ModelTestAutoIncrementFilterInput, limit: Int, nextToken: String, sortDirection: ModelSortDirection): ModelTestAutoIncrementConnection
}
input ModelTestAutoIncrementConditionInput {
value: ModelIntInput
and: [ModelTestAutoIncrementConditionInput]
or: [ModelTestAutoIncrementConditionInput]
not: ModelTestAutoIncrementConditionInput
}
input CreateTestAutoIncrementInput {
id: ID
value: Int
}
input UpdateTestAutoIncrementInput {
id: ID!
value: Int
}
input DeleteTestAutoIncrementInput {
id: ID!
}
type Mutation {
createTestAutoIncrement(input: CreateTestAutoIncrementInput!, condition: ModelTestAutoIncrementConditionInput): TestAutoIncrement
updateTestAutoIncrement(input: UpdateTestAutoIncrementInput!, condition: ModelTestAutoIncrementConditionInput): TestAutoIncrement
deleteTestAutoIncrement(input: DeleteTestAutoIncrementInput!, condition: ModelTestAutoIncrementConditionInput): TestAutoIncrement
}
input ModelSubscriptionTestAutoIncrementFilterInput {
id: ModelSubscriptionIDInput
value: ModelSubscriptionIntInput
and: [ModelSubscriptionTestAutoIncrementFilterInput]
or: [ModelSubscriptionTestAutoIncrementFilterInput]
}
type Subscription {
onCreateTestAutoIncrement(filter: ModelSubscriptionTestAutoIncrementFilterInput): TestAutoIncrement @aws_subscribe(mutations: [\\"createTestAutoIncrement\\"])
onUpdateTestAutoIncrement(filter: ModelSubscriptionTestAutoIncrementFilterInput): TestAutoIncrement @aws_subscribe(mutations: [\\"updateTestAutoIncrement\\"])
onDeleteTestAutoIncrement(filter: ModelSubscriptionTestAutoIncrementFilterInput): TestAutoIncrement @aws_subscribe(mutations: [\\"deleteTestAutoIncrement\\"])
}
"
`;

exports[`DefaultValueModelTransformer: should successfully transform simple valid schema 1`] = `
"type Post {
id: ID!
Expand Down
Loading

0 comments on commit 7ddef03

Please sign in to comment.