You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/appsync-modelgen-plugin/src/__tests__/visitors/__snapshots__/appsync-model-introspection-visitor.test.ts.snap
+324Lines changed: 324 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2320,3 +2320,327 @@ exports[`Primary key info within a belongsTo model tests should generate correct
2320
2320
\\"nonModels\\": {}
2321
2321
}"
2322
2322
`;
2323
+
2324
+
exports[`schemas with pk on a belongsTo fk works for v1 1`] =`
2325
+
"{
2326
+
\\"version\\": 1,
2327
+
\\"models\\": {
2328
+
\\"Blog\\": {
2329
+
\\"name\\": \\"Blog\\",
2330
+
\\"fields\\": {
2331
+
\\"id\\": {
2332
+
\\"name\\": \\"id\\",
2333
+
\\"isArray\\": false,
2334
+
\\"type\\": \\"ID\\",
2335
+
\\"isRequired\\": true,
2336
+
\\"attributes\\": []
2337
+
},
2338
+
\\"title\\": {
2339
+
\\"name\\": \\"title\\",
2340
+
\\"isArray\\": false,
2341
+
\\"type\\": \\"String\\",
2342
+
\\"isRequired\\": false,
2343
+
\\"attributes\\": []
2344
+
},
2345
+
\\"posts\\": {
2346
+
\\"name\\": \\"posts\\",
2347
+
\\"isArray\\": true,
2348
+
\\"type\\": {
2349
+
\\"model\\": \\"Post\\"
2350
+
},
2351
+
\\"isRequired\\": false,
2352
+
\\"attributes\\": [],
2353
+
\\"isArrayNullable\\": true,
2354
+
\\"association\\": {
2355
+
\\"connectionType\\": \\"HAS_MANY\\",
2356
+
\\"associatedWith\\": []
2357
+
}
2358
+
},
2359
+
\\"createdAt\\": {
2360
+
\\"name\\": \\"createdAt\\",
2361
+
\\"isArray\\": false,
2362
+
\\"type\\": \\"AWSDateTime\\",
2363
+
\\"isRequired\\": false,
2364
+
\\"attributes\\": [],
2365
+
\\"isReadOnly\\": true
2366
+
},
2367
+
\\"updatedAt\\": {
2368
+
\\"name\\": \\"updatedAt\\",
2369
+
\\"isArray\\": false,
2370
+
\\"type\\": \\"AWSDateTime\\",
2371
+
\\"isRequired\\": false,
2372
+
\\"attributes\\": [],
2373
+
\\"isReadOnly\\": true
2374
+
}
2375
+
},
2376
+
\\"syncable\\": true,
2377
+
\\"pluralName\\": \\"Blogs\\",
2378
+
\\"attributes\\": [
2379
+
{
2380
+
\\"type\\": \\"model\\",
2381
+
\\"properties\\": {}
2382
+
}
2383
+
],
2384
+
\\"primaryKeyInfo\\": {
2385
+
\\"isCustomPrimaryKey\\": false,
2386
+
\\"primaryKeyFieldName\\": \\"id\\",
2387
+
\\"sortKeyFieldNames\\": []
2388
+
}
2389
+
},
2390
+
\\"Post\\": {
2391
+
\\"name\\": \\"Post\\",
2392
+
\\"fields\\": {
2393
+
\\"id\\": {
2394
+
\\"name\\": \\"id\\",
2395
+
\\"isArray\\": false,
2396
+
\\"type\\": \\"ID\\",
2397
+
\\"isRequired\\": true,
2398
+
\\"attributes\\": []
2399
+
},
2400
+
\\"blogId\\": {
2401
+
\\"name\\": \\"blogId\\",
2402
+
\\"isArray\\": false,
2403
+
\\"type\\": \\"ID\\",
2404
+
\\"isRequired\\": true,
2405
+
\\"attributes\\": []
2406
+
},
2407
+
\\"title\\": {
2408
+
\\"name\\": \\"title\\",
2409
+
\\"isArray\\": false,
2410
+
\\"type\\": \\"String\\",
2411
+
\\"isRequired\\": true,
2412
+
\\"attributes\\": []
2413
+
},
2414
+
\\"description\\": {
2415
+
\\"name\\": \\"description\\",
2416
+
\\"isArray\\": false,
2417
+
\\"type\\": \\"String\\",
2418
+
\\"isRequired\\": true,
2419
+
\\"attributes\\": []
2420
+
},
2421
+
\\"blog\\": {
2422
+
\\"name\\": \\"blog\\",
2423
+
\\"isArray\\": false,
2424
+
\\"type\\": {
2425
+
\\"model\\": \\"Blog\\"
2426
+
},
2427
+
\\"isRequired\\": false,
2428
+
\\"attributes\\": [],
2429
+
\\"association\\": {
2430
+
\\"connectionType\\": \\"BELONGS_TO\\",
2431
+
\\"targetNames\\": []
2432
+
}
2433
+
},
2434
+
\\"createdAt\\": {
2435
+
\\"name\\": \\"createdAt\\",
2436
+
\\"isArray\\": false,
2437
+
\\"type\\": \\"AWSDateTime\\",
2438
+
\\"isRequired\\": false,
2439
+
\\"attributes\\": [],
2440
+
\\"isReadOnly\\": true
2441
+
},
2442
+
\\"updatedAt\\": {
2443
+
\\"name\\": \\"updatedAt\\",
2444
+
\\"isArray\\": false,
2445
+
\\"type\\": \\"AWSDateTime\\",
2446
+
\\"isRequired\\": false,
2447
+
\\"attributes\\": [],
2448
+
\\"isReadOnly\\": true
2449
+
}
2450
+
},
2451
+
\\"syncable\\": true,
2452
+
\\"pluralName\\": \\"Posts\\",
2453
+
\\"attributes\\": [
2454
+
{
2455
+
\\"type\\": \\"model\\",
2456
+
\\"properties\\": {}
2457
+
},
2458
+
{
2459
+
\\"type\\": \\"key\\",
2460
+
\\"properties\\": {
2461
+
\\"fields\\": [
2462
+
\\"blogId\\",
2463
+
\\"title\\",
2464
+
\\"description\\"
2465
+
]
2466
+
}
2467
+
}
2468
+
],
2469
+
\\"primaryKeyInfo\\": {
2470
+
\\"isCustomPrimaryKey\\": true,
2471
+
\\"primaryKeyFieldName\\": \\"blogId\\",
2472
+
\\"sortKeyFieldNames\\": [
2473
+
\\"title\\",
2474
+
\\"description\\"
2475
+
]
2476
+
}
2477
+
}
2478
+
},
2479
+
\\"enums\\": {},
2480
+
\\"nonModels\\": {}
2481
+
}"
2482
+
`;
2483
+
2484
+
exports[`schemas with pk on a belongsTo fk works for v2 1`] =`
0 commit comments