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
+312Lines changed: 312 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2347,6 +2347,318 @@ exports[`Primary Key Info tests should generate correct primary key info for mod
2347
2347
}"
2348
2348
`;
2349
2349
2350
+
exports[`Primary Key Info tests should retain order of targetNames and primaryKeyInfo.sortKeyFieldNames 1`] =`
2351
+
Object {
2352
+
"enums": Object {},
2353
+
"models": Object {
2354
+
"Enthusiast": Object {
2355
+
"attributes": Array [
2356
+
Object {
2357
+
"properties": Object {},
2358
+
"type": "model",
2359
+
},
2360
+
Object {
2361
+
"properties": Object {
2362
+
"fields": Array [
2363
+
"id",
2364
+
],
2365
+
},
2366
+
"type": "key",
2367
+
},
2368
+
],
2369
+
"fields": Object {
2370
+
"createdAt": Object {
2371
+
"attributes": Array [],
2372
+
"isArray": false,
2373
+
"isReadOnly": true,
2374
+
"isRequired": false,
2375
+
"name": "createdAt",
2376
+
"type": "AWSDateTime",
2377
+
},
2378
+
"id": Object {
2379
+
"attributes": Array [],
2380
+
"isArray": false,
2381
+
"isRequired": true,
2382
+
"name": "id",
2383
+
"type": "ID",
2384
+
},
2385
+
"likes": Object {
2386
+
"association": Object {
2387
+
"associatedWith": Array [
2388
+
"enthusiast",
2389
+
],
2390
+
"connectionType": "HAS_MANY",
2391
+
},
2392
+
"attributes": Array [],
2393
+
"isArray": true,
2394
+
"isArrayNullable": true,
2395
+
"isRequired": false,
2396
+
"name": "likes",
2397
+
"type": Object {
2398
+
"model": "EnthusiastLikes",
2399
+
},
2400
+
},
2401
+
"name": Object {
2402
+
"attributes": Array [],
2403
+
"isArray": false,
2404
+
"isRequired": true,
2405
+
"name": "name",
2406
+
"type": "String",
2407
+
},
2408
+
"updatedAt": Object {
2409
+
"attributes": Array [],
2410
+
"isArray": false,
2411
+
"isReadOnly": true,
2412
+
"isRequired": false,
2413
+
"name": "updatedAt",
2414
+
"type": "AWSDateTime",
2415
+
},
2416
+
},
2417
+
"name": "Enthusiast",
2418
+
"pluralName": "Enthusiasts",
2419
+
"primaryKeyInfo": Object {
2420
+
"isCustomPrimaryKey": false,
2421
+
"primaryKeyFieldName": "id",
2422
+
"sortKeyFieldNames": Array [],
2423
+
},
2424
+
"syncable": true,
2425
+
},
2426
+
"EnthusiastLikes": Object {
2427
+
"attributes": Array [
2428
+
Object {
2429
+
"properties": Object {},
2430
+
"type": "model",
2431
+
},
2432
+
Object {
2433
+
"properties": Object {
2434
+
"fields": Array [
2435
+
"enthusiastId",
2436
+
],
2437
+
"name": "byEnthusiast",
2438
+
},
2439
+
"type": "key",
2440
+
},
2441
+
Object {
2442
+
"properties": Object {
2443
+
"fields": Array [
2444
+
"likeName",
2445
+
"likesortKeyFieldOne",
2446
+
"likesortKeyFieldTwo",
2447
+
"likesortKeyFieldThree",
2448
+
],
2449
+
"name": "byLike",
2450
+
},
2451
+
"type": "key",
2452
+
},
2453
+
],
2454
+
"fields": Object {
2455
+
"createdAt": Object {
2456
+
"attributes": Array [],
2457
+
"isArray": false,
2458
+
"isReadOnly": true,
2459
+
"isRequired": false,
2460
+
"name": "createdAt",
2461
+
"type": "AWSDateTime",
2462
+
},
2463
+
"enthusiast": Object {
2464
+
"association": Object {
2465
+
"connectionType": "BELONGS_TO",
2466
+
"targetNames": Array [
2467
+
"enthusiastId",
2468
+
],
2469
+
},
2470
+
"attributes": Array [],
2471
+
"isArray": false,
2472
+
"isRequired": true,
2473
+
"name": "enthusiast",
2474
+
"type": Object {
2475
+
"model": "Enthusiast",
2476
+
},
2477
+
},
2478
+
"enthusiastId": Object {
2479
+
"attributes": Array [],
2480
+
"isArray": false,
2481
+
"isRequired": false,
2482
+
"name": "enthusiastId",
2483
+
"type": "ID",
2484
+
},
2485
+
"id": Object {
2486
+
"attributes": Array [],
2487
+
"isArray": false,
2488
+
"isRequired": true,
2489
+
"name": "id",
2490
+
"type": "ID",
2491
+
},
2492
+
"like": Object {
2493
+
"association": Object {
2494
+
"connectionType": "BELONGS_TO",
2495
+
"targetNames": Array [
2496
+
"likeName",
2497
+
"likesortKeyFieldOne",
2498
+
"likesortKeyFieldTwo",
2499
+
"likesortKeyFieldThree",
2500
+
],
2501
+
},
2502
+
"attributes": Array [],
2503
+
"isArray": false,
2504
+
"isRequired": true,
2505
+
"name": "like",
2506
+
"type": Object {
2507
+
"model": "Like",
2508
+
},
2509
+
},
2510
+
"likeName": Object {
2511
+
"attributes": Array [],
2512
+
"isArray": false,
2513
+
"isRequired": false,
2514
+
"name": "likeName",
2515
+
"type": "ID",
2516
+
},
2517
+
"likesortKeyFieldOne": Object {
2518
+
"attributes": Array [],
2519
+
"isArray": false,
2520
+
"isRequired": false,
2521
+
"name": "likesortKeyFieldOne",
2522
+
"type": "String",
2523
+
},
2524
+
"likesortKeyFieldThree": Object {
2525
+
"attributes": Array [],
2526
+
"isArray": false,
2527
+
"isRequired": false,
2528
+
"name": "likesortKeyFieldThree",
2529
+
"type": "String",
2530
+
},
2531
+
"likesortKeyFieldTwo": Object {
2532
+
"attributes": Array [],
2533
+
"isArray": false,
2534
+
"isRequired": false,
2535
+
"name": "likesortKeyFieldTwo",
2536
+
"type": "String",
2537
+
},
2538
+
"updatedAt": Object {
2539
+
"attributes": Array [],
2540
+
"isArray": false,
2541
+
"isReadOnly": true,
2542
+
"isRequired": false,
2543
+
"name": "updatedAt",
2544
+
"type": "AWSDateTime",
2545
+
},
2546
+
},
2547
+
"name": "EnthusiastLikes",
2548
+
"pluralName": "EnthusiastLikes",
2549
+
"primaryKeyInfo": Object {
2550
+
"isCustomPrimaryKey": false,
2551
+
"primaryKeyFieldName": "id",
2552
+
"sortKeyFieldNames": Array [],
2553
+
},
2554
+
"syncable": true,
2555
+
},
2556
+
"Like": Object {
2557
+
"attributes": Array [
2558
+
Object {
2559
+
"properties": Object {},
2560
+
"type": "model",
2561
+
},
2562
+
Object {
2563
+
"properties": Object {
2564
+
"fields": Array [
2565
+
"name",
2566
+
"sortKeyFieldOne",
2567
+
"sortKeyFieldTwo",
2568
+
"sortKeyFieldThree",
2569
+
],
2570
+
},
2571
+
"type": "key",
2572
+
},
2573
+
],
2574
+
"fields": Object {
2575
+
"createdAt": Object {
2576
+
"attributes": Array [],
2577
+
"isArray": false,
2578
+
"isReadOnly": true,
2579
+
"isRequired": false,
2580
+
"name": "createdAt",
2581
+
"type": "AWSDateTime",
2582
+
},
2583
+
"enthusiasts": Object {
2584
+
"association": Object {
2585
+
"associatedWith": Array [
2586
+
"like",
2587
+
],
2588
+
"connectionType": "HAS_MANY",
2589
+
},
2590
+
"attributes": Array [],
2591
+
"isArray": true,
2592
+
"isArrayNullable": true,
2593
+
"isRequired": false,
2594
+
"name": "enthusiasts",
2595
+
"type": Object {
2596
+
"model": "EnthusiastLikes",
2597
+
},
2598
+
},
2599
+
"name": Object {
2600
+
"attributes": Array [],
2601
+
"isArray": false,
2602
+
"isRequired": true,
2603
+
"name": "name",
2604
+
"type": "String",
2605
+
},
2606
+
"sortKeyFieldOne": Object {
2607
+
"attributes": Array [],
2608
+
"isArray": false,
2609
+
"isRequired": true,
2610
+
"name": "sortKeyFieldOne",
2611
+
"type": "String",
2612
+
},
2613
+
"sortKeyFieldThree": Object {
2614
+
"attributes": Array [],
2615
+
"isArray": false,
2616
+
"isRequired": true,
2617
+
"name": "sortKeyFieldThree",
2618
+
"type": "String",
2619
+
},
2620
+
"sortKeyFieldTwo": Object {
2621
+
"attributes": Array [],
2622
+
"isArray": false,
2623
+
"isRequired": true,
2624
+
"name": "sortKeyFieldTwo",
2625
+
"type": "String",
2626
+
},
2627
+
"updatedAt": Object {
2628
+
"attributes": Array [],
2629
+
"isArray": false,
2630
+
"isReadOnly": true,
2631
+
"isRequired": false,
2632
+
"name": "updatedAt",
2633
+
"type": "AWSDateTime",
2634
+
},
2635
+
"value": Object {
2636
+
"attributes": Array [],
2637
+
"isArray": false,
2638
+
"isRequired": true,
2639
+
"name": "value",
2640
+
"type": "String",
2641
+
},
2642
+
},
2643
+
"name": "Like",
2644
+
"pluralName": "Likes",
2645
+
"primaryKeyInfo": Object {
2646
+
"isCustomPrimaryKey": true,
2647
+
"primaryKeyFieldName": "name",
2648
+
"sortKeyFieldNames": Array [
2649
+
"sortKeyFieldOne",
2650
+
"sortKeyFieldTwo",
2651
+
"sortKeyFieldThree",
2652
+
],
2653
+
},
2654
+
"syncable": true,
2655
+
},
2656
+
},
2657
+
"nonModels": Object {},
2658
+
"version": 1,
2659
+
}
2660
+
`;
2661
+
2350
2662
exports[`Primary key info within a belongsTo model tests should generate correct primary key info for model when the primary key field is part of belongsTo connection field and custom PK is disabled 1`] =`
0 commit comments