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

[GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSTimestamp' within parent 'Blog' #5886

Open
JalalFaisalRassam opened this issue Jan 30, 2025 · 3 comments
Assignees
Labels
datastore Issues related to the DataStore Category GraphQL API Issues related to the API (GraphQL) Category pending-maintainer-response Pending response from a maintainer of this repository pending-triage This issue is in the backlog of issues to triage to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided

Comments

@JalalFaisalRassam
Copy link

i use flutter framework with amplify and when i built my app i face the this issue when i insert the the posts inside a Blog which they have one to many relationship

this happens when i add post inside the log
and the while the Blog is added successfully the Posts addition fails and the error appears

/////////////////////////////////////
the console logs
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/amplify:aws-datastore(17179): at java.lang.Thread.run(Thread.java:919)
I/amplify:aws-datastore(17179): Successfully removed from mutations outboxPendingMutation{mutatedItem=SerializedModel{id='d9d44936-9eee-4e55-b22a-1c93c74c3346', serializedData={createdAt=null, id=d9d44936-9eee-4e55-b22a-1c93c74c3346, blog=SerializedModel{id='9f7c596c-b50b-49ed-a94a-6b1f41d2227e', serializedData={id=9f7c596c-b50b-49ed-a94a-6b1f41d2227e}, modelName=Blog}, title=لللل, updatedAt=null}, modelName=Post}, mutationType=CREATE, mutationId=b14450dd-ddb8-11ef-aae8-31c86b5b7f2d, predicate=MatchAllQueryPredicate}
I/amplify:flutter:datastore(17179): Unhandled DataStoreHubEvent: outboxMutationFailed
I/amplify:flutter:datastore(17179): OutboxMutationFailedEvent{errorType=UNKNOWN, operation=CREATE, modelName=Post, model=SerializedModel{id='d9d44936-9eee-4e55-b22a-1c93c74c3346', serializedData={createdAt=null, id=d9d44936-9eee-4e55-b22a-1c93c74c3346, blog=SerializedModel{id='9f7c596c-b50b-49ed-a94a-6b1f41d2227e', serializedData={id=9f7c596c-b50b-49ed-a94a-6b1f41d2227e}, modelName=Blog}, title=لللل, updatedAt=null}, modelName=Post}}
E/amplify:flutter:datastore(17179): GraphQLResponseException{message=Mutation failed. Failed mutation = PendingMutation{mutatedItem=SerializedModel{id='d9d44936-9eee-4e55-b22a-1c93c74c3346', serializedData={createdAt=null, id=d9d44936-9eee-4e55-b22a-1c93c74c3346, blog=SerializedModel{id='9f7c596c-b50b-49ed-a94a-6b1f41d2227e', serializedData={id=9f7c596c-b50b-49ed-a94a-6b1f41d2227e}, modelName=Blog}, title=لللل, updatedAt=null}, modelName=Post}, mutationType=CREATE, mutationId=b14450dd-ddb8-11ef-aae8-31c86b5b7f2d, predicate=MatchAllQueryPredicate}. AppSync response contained errors = [GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSTimestamp' within parent 'Blog' (/createPost/blog/_lastChangedAt)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='_lastChangedAt'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'Int' within parent 'Blog' (/createPost/blog/_version)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='_version'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSDateTime' within parent 'Blog' (/createPost/blog/createdAt)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='createdAt'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'ID' within parent 'Blog' (/createPost/blog/id)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='id'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Blog' (/createPost/blog/name)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='name'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSDateTime' within parent 'Blog' (/createPost/blog/updatedAt)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='updatedAt'}]', extensions='null'}], errors=[GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSTimestamp' within parent 'Blog' (/createPost/blog/_lastChangedAt)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='_lastChangedAt'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'Int' within parent 'Blog' (/createPost/blog/_version)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='_version'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSDateTime' within parent 'Blog' (/createPost/blog/createdAt)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='createdAt'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'ID' within parent 'Blog' (/createPost/blog/id)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='id'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'String' within parent 'Blog' (/createPost/blog/name)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{value='name'}]', extensions='null'}, GraphQLResponse.Error{message='Cannot return null for non-nullable type: 'AWSDateTime' within parent 'Blog' (/createPost/blog/updatedAt)', locations='null', path='[GraphQLPathSegment{value='createPost'}, GraphQLPathSegment{value='blog'}, GraphQLPathSegment{

@github-actions github-actions bot added pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Jan 30, 2025
@JalalFaisalRassam
Copy link
Author

here is the link of the test repo to check if i missed any thing in the code or configuration
https://github.com/JalalFaisalRassam/amplify_test_flutter_app

@jordanvn
Copy link
Member

Hi @JalalFaisalRassam 👋 Thanks for reaching out with this issue. I'll transfer this to the Flutter team so you can get the most relevant help.

@jordanvn jordanvn transferred this issue from aws-amplify/amplify-ui Jan 30, 2025
@ekjotmultani ekjotmultani self-assigned this Jan 30, 2025
@ekjotmultani
Copy link
Member

Hi @JalalFaisalRassam just wanted to confirm, this is the schema you are using, correct?

type Blog @model @auth(rules: [{ allow: owner }]){
  id: ID!
  name: String!
  posts: [Post] @hasMany
}

type Post @model @auth(rules: [{ allow: owner }]){
  id: ID!
  title: String!
  blog: Blog @belongsTo
  comments: [Comment] @hasMany
}

type Comment @model @auth(rules: [{ allow: owner }]){
  id: ID!
  post: Post @belongsTo
  content: String!
}

We will take this and attempt to reproduce the issue and get back with an update

@github-actions github-actions bot removed the pending-maintainer-response Pending response from a maintainer of this repository label Jan 30, 2025
@ekjotmultani ekjotmultani added datastore Issues related to the DataStore Category GraphQL API Issues related to the API (GraphQL) Category pending-maintainer-response Pending response from a maintainer of this repository to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datastore Issues related to the DataStore Category GraphQL API Issues related to the API (GraphQL) Category pending-maintainer-response Pending response from a maintainer of this repository pending-triage This issue is in the backlog of issues to triage to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided
Projects
None yet
Development

No branches or pull requests

3 participants