question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWSTimestamp on input becomes Int on the condition

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v12.18.0

Amplify CLI Version

4.45.0

What operating system are you using?

MacOs

Amplify Categories

api

Amplify Commands

codegen

Describe the bug

I have a model

type Player @aws_iam
@aws_cognito_user_pools {
	lastinteraction: AWSTimestamp
        ...
}

and the codegen commands generates

input ModelPlayerConditionInput {
	lastinteraction: ModelIntInput
        ...
}

where ModelIntInput is:

input ModelIntInput {
	ne: Int
	eq: Int
	le: Int
	lt: Int
	ge: Int
	gt: Int
	between: [Int]
	attributeExists: Boolean
	attributeType: ModelAttributeTypes
}

However Int is not enough for a timestamp, since from the documentation Int can hold at most 2^32, but the timestamp is something like 2^40

Expected behavior

Sincerely i don’t know, maybe aFloat can be used, but it’s obviously not the best choice since maybe a Long might be what we want

Reproduction steps

Implement that model and then generate all the default mutations

Log output

No response

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AlbertoSinigagliacommented, Mar 18, 2021

Hi @AlbertoSinigaglia. We have discussed this internally, and would prefer not to make this change at this time. With the understanding that AWSTimestamp units are seconds and not milliseconds, are you unblocked?

yes yes sure, I’ve just divided the millis by 1000 and casted to Int, and job done, thank you

0reactions
github-actions[bot]commented, May 25, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scalar types in AWS AppSync
AWS AppSync scalars list · AWSTimestamp. An integer value representing the number of seconds before or after 1970-01-01-T00:00Z . · AWSEmail. An email...
Read more >
Why does a GraphQL query return null? - Stack Overflow
So, in my schema (on the AppSync console) I had this: type TypeName { id: ID! ... _version: Int! _deleted: Boolean _lastChangedAt: AWSTimestamp!...
Read more >
Exploring GraphQL Directives in the Wild | StepZen blog
Data mocking; Improving performance; Input validation; Logging; Security; Setting default values; User authorization control. Some time ago, I ...
Read more >
Bing's Tech Notes - AppSync - Google Sites
GraphQL, real time (MQTT) & offline programming. Integrate with DynamoDB (schema -> resource, import from existing DynamoDB table).
Read more >
API (GraphQL) - Define your model types - AWS Amplify Docs
Filter input objects that allow you to filter objects in list queries and ... ID } input ModelIntFilterInput { ne: Int eq: Int...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found