Closed volkanunsal closed 3 years ago
Please post your schema, as well as the output from npx envinfo --system --binaries --browsers --npmPackages --npmGlobalPackages
schema:
export const schema = {
models: {
Org: {
name: 'Org',
fields: {
id: {
name: 'id',
isArray: false,
type: 'ID',
isRequired: true,
attributes: [],
},
name: {
name: 'name',
isArray: false,
type: 'String',
isRequired: true,
attributes: [],
},
address: {
name: 'address',
isArray: false,
type: 'String',
isRequired: true,
attributes: [],
},
lon: {
name: 'lon',
isArray: false,
type: 'String',
isRequired: false,
attributes: [],
},
lat: {
name: 'lat',
isArray: false,
type: 'String',
isRequired: false,
attributes: [],
},
elections: {
name: 'elections',
isArray: true,
type: {
model: 'Election',
},
isRequired: false,
attributes: [],
isArrayNullable: true,
association: {
connectionType: 'HAS_MANY',
associatedWith: 'org',
},
},
},
syncable: true,
pluralName: 'Orgs',
attributes: [
{
type: 'model',
properties: {},
},
{
type: 'auth',
properties: {
rules: [
{
provider: 'userPools',
ownerField: 'owner',
allow: 'owner',
identityClaim: 'cognito:username',
operations: ['create', 'update', 'delete', 'read'],
},
],
},
},
],
},
Election: {
name: 'Election',
fields: {
id: {
name: 'id',
isArray: false,
type: 'ID',
isRequired: true,
attributes: [],
},
title: {
name: 'title',
isArray: false,
type: 'String',
isRequired: true,
attributes: [],
},
date: {
name: 'date',
isArray: false,
type: 'AWSDate',
isRequired: true,
attributes: [],
},
result: {
name: 'result',
isArray: false,
type: 'String',
isRequired: true,
attributes: [],
},
lon: {
name: 'lon',
isArray: false,
type: 'String',
isRequired: false,
attributes: [],
},
lat: {
name: 'lat',
isArray: false,
type: 'String',
isRequired: false,
attributes: [],
},
org: {
name: 'org',
isArray: false,
type: {
model: 'Org',
},
isRequired: false,
attributes: [],
association: {
connectionType: 'BELONGS_TO',
targetName: 'orgId',
},
},
},
syncable: true,
pluralName: 'Elections',
attributes: [
{
type: 'key',
properties: {
name: 'byOrg',
fields: ['orgId'],
},
},
{
type: 'model',
properties: {},
},
],
},
},
enums: {},
nonModels: {},
version: 'c4093412cda80f32623de95ec69b6508',
};
And the output:
System:
OS: macOS 10.15.6
CPU: (4) x64 Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz
Memory: 240.17 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 15.4.0 - ~/.volta/tools/image/node/15.4.0/bin/node
Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
npm: 7.0.15 - ~/.volta/tools/image/node/15.4.0/bin/npm
Watchman: 3.3.0 - /usr/local/bin/watchman
Browsers:
Chrome: 89.0.4389.82
Firefox: 85.0.2
Safari: 14.0
npmPackages:
@aws-amplify/ui-components: ^1.0.3 => 1.0.3
@emotion/react: ^11.1.4 => 11.1.5
@rjsf/core: ^2.4.2 => 2.4.2
@snowpack/plugin-dotenv: ^2.0.5 => 2.0.5
@snowpack/plugin-react-refresh: ^2.4.0 => 2.4.0
@snowpack/plugin-typescript: ^1.2.0 => 1.2.1
@snowpack/web-test-runner-plugin: ^0.2.0 => 0.2.1
@testing-library/react: ^11.0.0 => 11.2.5
@types/chai: ^4.2.13 => 4.2.15
@types/classnames: ^2.2.11 => 2.2.11
@types/d3-array: ^2.9.0 => 2.9.0
@types/d3-axis: ^2.0.0 => 2.0.0
@types/d3-color: ^2.0.1 => 2.0.1
@types/d3-ease: ^2.0.0 => 2.0.0
@types/d3-format: ^2.0.0 => 2.0.0
@types/d3-interpolate: ^2.0.0 => 2.0.0
@types/d3-scale: ^3.2.2 => 3.2.2
@types/d3-scale-chromatic: ^2.0.0 => 2.0.0
@types/d3-selection: ^2.0.0 => 2.0.0
@types/d3-shape: ^2.0.0 => 2.0.0
@types/d3-time-format: ^3.0.0 => 3.0.0
@types/d3-transition: ^2.0.0 => 2.0.0
@types/lz-string: ^1.3.34 => 1.3.34
@types/mocha: ^8.2.0 => 8.2.1
@types/react: ^17.0.0 => 17.0.2
@types/react-date-range: ^1.1.4 => 1.1.4
@types/react-dom: ^17.0.0 => 17.0.1
@types/react-input-mask: ^3.0.0 => 3.0.0
@types/react-phone-number-input: ^3.0.6 => 3.0.6
@types/react-router: ^5.1.11 => 5.1.11
@types/react-router-dom: ^5.1.7 => 5.1.7
@types/react-select: ^4.0.13 => 4.0.13
@types/snowpack-env: ^2.3.2 => 2.3.3
@volkanunsal/rjsf-bootstrap-5: ^2.4.10 => 2.4.12
@web/test-runner: ^0.12.0 => 0.12.15
ajv: ^6.7.0 => 6.12.6
ajv-errors: ^2.0.0 => 2.0.0
aws-amplify: ^3.3.21 => 3.3.22
chai: ^4.2.0 => 4.3.0
classnames: ^2.2.6 => 2.2.6
d3-array: ^2.11.0 => 2.11.0
d3-axis: ^2.0.0 => 2.0.0
d3-color: ^2.0.0 => 2.0.0
d3-ease: ^2.0.0 => 2.0.0
d3-format: ^2.0.0 => 2.0.0
d3-interpolate: ^2.0.1 => 2.0.1
d3-scale: ^3.2.3 => 3.2.3
d3-scale-chromatic: ^2.0.0 => 2.0.0
d3-selection: ^2.0.0 => 2.0.0
d3-shape: ^2.0.0 => 2.0.0
d3-time-format: ^3.0.0 => 3.0.0
d3-transition: ^2.0.0 => 2.0.0
date-fns: ^2.19.0 => 2.19.0
graphql: ^15.5.0 => 15.5.0
greenlet: ^1.1.0 => 1.1.0
immutable: ^4.0.0-rc.12 => 4.0.0-rc.12
lz-string: ^1.4.4 => 1.4.4
prettier: ^2.0.5 => 2.2.1
react: ^17.0.0 => 17.0.1
react-bootstrap: ^1.5.0 => 1.5.0
react-date-range: ^1.1.3 => 1.1.3
react-dom: ^17.0.0 => 17.0.1
react-input-mask: ^3.0.0-alpha.2 => 3.0.0-alpha.2
react-phone-number-input: ^3.1.16 => 3.1.16
react-router: ^5.2.0 => 5.2.0
react-router-dom: ^5.2.0 => 5.2.0
react-select: ^4.2.1 => 4.2.1
redux: ^4.0.5 => 4.0.5
rollup: ^2.39.1 => 2.39.1
snowpack: ^3.0.13 => 3.0.13
snowpack-plugin-svgr: ^0.1.2 => 0.1.2
typescript: ^4.0.0 => 4.2.2
valtio: ^0.7.0 => 0.7.0
npmGlobalPackages:
npm: 7.0.15
Thanks. Can you also share the schema.graphql
?
Here it is
type Org @model @auth(rules: [{ allow: owner }]) {
id: ID!
name: String!
address: String!
lon: String
lat: String
elections: [Election] @connection(keyName: "byOrg", fields: ["id"])
}
type Election @key(name: "byOrg", fields: ["orgId"]) @model {
id: ID!
title: String!
date: AWSDate!
result: String!
lon: String
lat: String
orgId: ID!
org: Org @connection(fields: ["orgId"])
}
Thanks! Could you try removing the org
field from your Election model, then amplify push
, amplify codegen models
and see if you're still getting the same error?
In other words, try this schema:
type Org @model @auth(rules: [{ allow: owner }]) {
id: ID!
name: String!
address: String!
lon: String
lat: String
elections: [Election] @connection(keyName: "byOrg", fields: ["id"])
}
type Election @key(name: "byOrg", fields: ["orgId"]) @model {
id: ID!
title: String!
date: AWSDate!
result: String!
lon: String
lat: String
orgId: ID!
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.
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 or Discussions for those types of questions.
Describe the bug
I'm trying to use DataStore and getting this error. This is my code:
Here is the screenshot:
It's coming from IndexedDBAdapter's
getAll
method.