Skip to content

Commit

Permalink
test: add second ref test schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilch committed Apr 10, 2024
1 parent a9d9ccf commit 22a0149
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,31 @@ describe('build app - Android', () => {
`,
},
],
[
'references-with-sort-key',
{
description: '@hasMany using references and @primaryKey using sortKeyFields',
transformerVersion: TransformerVersion.v2,
supportedPlatforms: TransformerPlatform.all,
sdl: `
type Primary @model {
tenantId: ID! @primaryKey(sortKeyFields: ["instanceId", "recordId"])
instanceId: ID!
recordId: ID!
content: String
related: [Related!] @hasMany(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"])
}
type Related @model {
content: String
primaryTenantId: ID!
primaryInstanceId: ID!
primaryRecordId: ID!
primary: Primary @belongsTo(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"])
}
`,
},
],
]).forEach(([schemaName, schema]) => {
// @ts-ignore
const testName = `builds with ${schemaName}: ${schema.description}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,31 @@ describe('build app - Swift', () => {
`,
},
],
[
'references-with-sort-key',
{
description: '@hasMany using references and @primaryKey using sortKeyFields',
transformerVersion: TransformerVersion.v2,
supportedPlatforms: TransformerPlatform.all,
sdl: `
type Primary @model {
tenantId: ID! @primaryKey(sortKeyFields: ["instanceId", "recordId"])
instanceId: ID!
recordId: ID!
content: String
related: [Related!] @hasMany(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"])
}
type Related @model {
content: String
primaryTenantId: ID!
primaryInstanceId: ID!
primaryRecordId: ID!
primary: Primary @belongsTo(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"])
}
`,
},
],
]).forEach(([schemaName, schema]) => {
// @ts-ignore
const testName = `builds with ${schemaName}: ${schema.description}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,31 @@ describe('build app - JS', () => {
`,
},
],
[
'references-with-sort-key',
{
description: '@hasMany using references and @primaryKey using sortKeyFields',
transformerVersion: TransformerVersion.v2,
supportedPlatforms: TransformerPlatform.all,
sdl: `
type Primary @model {
tenantId: ID! @primaryKey(sortKeyFields: ["instanceId", "recordId"])
instanceId: ID!
recordId: ID!
content: String
related: [Related!] @hasMany(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"])
}
type Related @model {
content: String
primaryTenantId: ID!
primaryInstanceId: ID!
primaryRecordId: ID!
primary: Primary @belongsTo(references: ["primaryTenantId", "primaryInstanceId", "primaryRecordId"])
}
`,
},
],
]).forEach(([schemaName, schema]) => {
const testName = `builds with ${schemaName}: ${(schema as any).description}`;
const testFunction = async () => {
Expand Down

0 comments on commit 22a0149

Please sign in to comment.