fragment-dev 1.1.9 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1256a2501256872db6fad263e03097745bcc3c513c1ec9e90ed0d479cfaa6a1e
4
- data.tar.gz: 76988aa363dee3e07b4e8cab9f4fb490f6a11aae83a1270ddf3606592736972e
3
+ metadata.gz: 2d55d9b6473ef1e2ffa37c7325ff21f2b209ba2bad881e45b0b46266a941eb2e
4
+ data.tar.gz: 1dc8bdc02af6cfbb2d846ab71c5f406eb568376cf18c941f224ddda6a85b7cc1
5
5
  SHA512:
6
- metadata.gz: c4c0249bfd26e434a30ea4a421dbf6c9bfc3fbf78dfc0c931c58fd396c257c8ac7566ce487077b0c3802365badffb6689e4ba07040c8dbe3ce7066f91a63ad88
7
- data.tar.gz: beba0d40d345f4fc1166cdb6c71d99218a0a4e48fbdd508c9f95847edba75120005b07f565c249ead19542de748a845e7354e960b816c2035b40dee1823bf896
6
+ metadata.gz: dd81589cf3a8f31f17fffd03621552f0884f1e70ce0e2b0e2516166b200a2eca9f470a4b82bf86126916582edf2dc28b0dee6bb8d0dacc7b212b99fb986225e0
7
+ data.tar.gz: 8e17754d3acbf6118ee0ade8397f9105e51483528647dfbc84dc6537907ca48e89f070117160611e7430491abaee49fa8dbc09580fde99943b6f96b7d31d295e
@@ -3565,6 +3565,74 @@
3565
3565
  "enumValues": null,
3566
3566
  "possibleTypes": null
3567
3567
  },
3568
+ {
3569
+ "kind": "INPUT_OBJECT",
3570
+ "name": "GroupFilter",
3571
+ "description": "Filter for finding entries by group membership",
3572
+ "fields": null,
3573
+ "inputFields": [
3574
+ {
3575
+ "name": "keyIn",
3576
+ "description": "Find entries that are members of a group with all of these group keys",
3577
+ "type": {
3578
+ "kind": "LIST",
3579
+ "name": null,
3580
+ "ofType": {
3581
+ "kind": "NON_NULL",
3582
+ "name": null,
3583
+ "ofType": {
3584
+ "kind": "SCALAR",
3585
+ "name": "SafeString",
3586
+ "ofType": null
3587
+ }
3588
+ }
3589
+ },
3590
+ "defaultValue": null
3591
+ },
3592
+ {
3593
+ "name": "not",
3594
+ "description": "Find entries that do not match this predicate",
3595
+ "type": {
3596
+ "kind": "INPUT_OBJECT",
3597
+ "name": "GroupNotFilter",
3598
+ "ofType": null
3599
+ },
3600
+ "defaultValue": null
3601
+ }
3602
+ ],
3603
+ "interfaces": null,
3604
+ "enumValues": null,
3605
+ "possibleTypes": null
3606
+ },
3607
+ {
3608
+ "kind": "INPUT_OBJECT",
3609
+ "name": "GroupNotFilter",
3610
+ "description": "Filter for finding entries that do not match this predicate",
3611
+ "fields": null,
3612
+ "inputFields": [
3613
+ {
3614
+ "name": "keyIn",
3615
+ "description": "Find entries that are not members of all of these groups. This is an AND filter.",
3616
+ "type": {
3617
+ "kind": "LIST",
3618
+ "name": null,
3619
+ "ofType": {
3620
+ "kind": "NON_NULL",
3621
+ "name": null,
3622
+ "ofType": {
3623
+ "kind": "SCALAR",
3624
+ "name": "SafeString",
3625
+ "ofType": null
3626
+ }
3627
+ }
3628
+ },
3629
+ "defaultValue": null
3630
+ }
3631
+ ],
3632
+ "interfaces": null,
3633
+ "enumValues": null,
3634
+ "possibleTypes": null
3635
+ },
3568
3636
  {
3569
3637
  "kind": "OBJECT",
3570
3638
  "name": "HistoricalBalance",
@@ -6353,6 +6421,36 @@
6353
6421
  },
6354
6422
  "defaultValue": null
6355
6423
  },
6424
+ {
6425
+ "name": "group",
6426
+ "description": "Use this to filter Ledger Entries by groups. The response will include entries that contain or do not contain specific groups.",
6427
+ "type": {
6428
+ "kind": "INPUT_OBJECT",
6429
+ "name": "GroupFilter",
6430
+ "ofType": null
6431
+ },
6432
+ "defaultValue": null
6433
+ },
6434
+ {
6435
+ "name": "isReversal",
6436
+ "description": "Use this to filter Ledger Entries that were posted using `reverseLedgerEntry`.",
6437
+ "type": {
6438
+ "kind": "SCALAR",
6439
+ "name": "Boolean",
6440
+ "ofType": null
6441
+ },
6442
+ "defaultValue": null
6443
+ },
6444
+ {
6445
+ "name": "isReversed",
6446
+ "description": "Use this to filter Ledger Entries that have been reversed.",
6447
+ "type": {
6448
+ "kind": "SCALAR",
6449
+ "name": "Boolean",
6450
+ "ofType": null
6451
+ },
6452
+ "defaultValue": null
6453
+ },
6356
6454
  {
6357
6455
  "name": "ledgerEntry",
6358
6456
  "description": "Use to filter Ledger Entries by their IDs or IKs.",
@@ -6373,6 +6471,16 @@
6373
6471
  },
6374
6472
  "defaultValue": null
6375
6473
  },
6474
+ {
6475
+ "name": "showHidden",
6476
+ "description": "Use this filter to show hidden Ledger Entries.",
6477
+ "type": {
6478
+ "kind": "SCALAR",
6479
+ "name": "Boolean",
6480
+ "ofType": null
6481
+ },
6482
+ "defaultValue": null
6483
+ },
6376
6484
  {
6377
6485
  "name": "tag",
6378
6486
  "description": "Use this to filter Ledger Entries by tags. The response will include entries that contain tags matching the filter.",
@@ -6511,6 +6619,22 @@
6511
6619
  "isDeprecated": false,
6512
6620
  "deprecationReason": null
6513
6621
  },
6622
+ {
6623
+ "name": "hidden",
6624
+ "description": "Indicates whether this Ledger Entry is hidden when listing Ledger Entries.\nReversed and Reversal Ledger Entries are hidden by default because taken together they have no impact on a Ledger's balances.",
6625
+ "args": [],
6626
+ "type": {
6627
+ "kind": "NON_NULL",
6628
+ "name": null,
6629
+ "ofType": {
6630
+ "kind": "SCALAR",
6631
+ "name": "Boolean",
6632
+ "ofType": null
6633
+ }
6634
+ },
6635
+ "isDeprecated": false,
6636
+ "deprecationReason": null
6637
+ },
6514
6638
  {
6515
6639
  "name": "id",
6516
6640
  "description": "The ID of this LedgerEntry.",
@@ -6543,6 +6667,38 @@
6543
6667
  "isDeprecated": false,
6544
6668
  "deprecationReason": null
6545
6669
  },
6670
+ {
6671
+ "name": "isReversal",
6672
+ "description": "Indicates whether this Ledger Entry is a reversal of another Ledger Entry.\nIf so, reverses will point to that Ledger Entry.",
6673
+ "args": [],
6674
+ "type": {
6675
+ "kind": "NON_NULL",
6676
+ "name": null,
6677
+ "ofType": {
6678
+ "kind": "SCALAR",
6679
+ "name": "Boolean",
6680
+ "ofType": null
6681
+ }
6682
+ },
6683
+ "isDeprecated": false,
6684
+ "deprecationReason": null
6685
+ },
6686
+ {
6687
+ "name": "isReversed",
6688
+ "description": "Indicates whether this Ledger Entry has been reversed by another Ledger Entry.\nIf so, reversedBy will point to that Ledger Entry.",
6689
+ "args": [],
6690
+ "type": {
6691
+ "kind": "NON_NULL",
6692
+ "name": null,
6693
+ "ofType": {
6694
+ "kind": "SCALAR",
6695
+ "name": "Boolean",
6696
+ "ofType": null
6697
+ }
6698
+ },
6699
+ "isDeprecated": false,
6700
+ "deprecationReason": null
6701
+ },
6546
6702
  {
6547
6703
  "name": "ledger",
6548
6704
  "description": "The Ledger that this Ledger Entry is posted to.",
@@ -6619,6 +6775,74 @@
6619
6775
  "isDeprecated": false,
6620
6776
  "deprecationReason": null
6621
6777
  },
6778
+ {
6779
+ "name": "reversalHistory",
6780
+ "description": "The reversal history of this Ledger Entry. Each entry in this connection shares the same IK.",
6781
+ "args": [],
6782
+ "type": {
6783
+ "kind": "NON_NULL",
6784
+ "name": null,
6785
+ "ofType": {
6786
+ "kind": "OBJECT",
6787
+ "name": "LedgerEntriesConnection",
6788
+ "ofType": null
6789
+ }
6790
+ },
6791
+ "isDeprecated": false,
6792
+ "deprecationReason": null
6793
+ },
6794
+ {
6795
+ "name": "reversalPosition",
6796
+ "description": "The position of this Ledger Entry in its reversalHistory. This is a one-indexed value, so the initial entry will have reversalPosition 1.",
6797
+ "args": [],
6798
+ "type": {
6799
+ "kind": "NON_NULL",
6800
+ "name": null,
6801
+ "ofType": {
6802
+ "kind": "SCALAR",
6803
+ "name": "Int",
6804
+ "ofType": null
6805
+ }
6806
+ },
6807
+ "isDeprecated": false,
6808
+ "deprecationReason": null
6809
+ },
6810
+ {
6811
+ "name": "reversedAt",
6812
+ "description": "ISO-8601 timestamp of when this Ledger Entry was reversed.",
6813
+ "args": [],
6814
+ "type": {
6815
+ "kind": "SCALAR",
6816
+ "name": "DateTime",
6817
+ "ofType": null
6818
+ },
6819
+ "isDeprecated": false,
6820
+ "deprecationReason": null
6821
+ },
6822
+ {
6823
+ "name": "reversedBy",
6824
+ "description": "The Ledger Entry that reversed this Ledger Entry.",
6825
+ "args": [],
6826
+ "type": {
6827
+ "kind": "OBJECT",
6828
+ "name": "LedgerEntry",
6829
+ "ofType": null
6830
+ },
6831
+ "isDeprecated": false,
6832
+ "deprecationReason": null
6833
+ },
6834
+ {
6835
+ "name": "reverses",
6836
+ "description": "The Ledger Entry that was reversed by this Ledger Entry.",
6837
+ "args": [],
6838
+ "type": {
6839
+ "kind": "OBJECT",
6840
+ "name": "LedgerEntry",
6841
+ "ofType": null
6842
+ },
6843
+ "isDeprecated": false,
6844
+ "deprecationReason": null
6845
+ },
6622
6846
  {
6623
6847
  "name": "tags",
6624
6848
  "description": "The set of tags attached to this Ledger Entry.",
@@ -7835,6 +8059,22 @@
7835
8059
  "isDeprecated": false,
7836
8060
  "deprecationReason": null
7837
8061
  },
8062
+ {
8063
+ "name": "hidden",
8064
+ "description": "Indicates whether this Ledger Line is hidden when listing Ledger Lines.\nReversed and Reversal Ledger Lines are hidden by default because taken together they have no impact on a Ledger Account's balance",
8065
+ "args": [],
8066
+ "type": {
8067
+ "kind": "NON_NULL",
8068
+ "name": null,
8069
+ "ofType": {
8070
+ "kind": "SCALAR",
8071
+ "name": "Boolean",
8072
+ "ofType": null
8073
+ }
8074
+ },
8075
+ "isDeprecated": false,
8076
+ "deprecationReason": null
8077
+ },
7838
8078
  {
7839
8079
  "name": "id",
7840
8080
  "description": null,
@@ -7851,6 +8091,38 @@
7851
8091
  "isDeprecated": false,
7852
8092
  "deprecationReason": null
7853
8093
  },
8094
+ {
8095
+ "name": "isReversal",
8096
+ "description": "Indicates whether this Ledger Line is a reversal of another Ledger Line.\nIf so, reverses will point to that Ledger Line.",
8097
+ "args": [],
8098
+ "type": {
8099
+ "kind": "NON_NULL",
8100
+ "name": null,
8101
+ "ofType": {
8102
+ "kind": "SCALAR",
8103
+ "name": "Boolean",
8104
+ "ofType": null
8105
+ }
8106
+ },
8107
+ "isDeprecated": false,
8108
+ "deprecationReason": null
8109
+ },
8110
+ {
8111
+ "name": "isReversed",
8112
+ "description": "Indicates whether this Ledger Line has been reversed by another Ledger Line.\nIf so, reversedBy will point to that Ledger Line.",
8113
+ "args": [],
8114
+ "type": {
8115
+ "kind": "NON_NULL",
8116
+ "name": null,
8117
+ "ofType": {
8118
+ "kind": "SCALAR",
8119
+ "name": "Boolean",
8120
+ "ofType": null
8121
+ }
8122
+ },
8123
+ "isDeprecated": false,
8124
+ "deprecationReason": null
8125
+ },
7854
8126
  {
7855
8127
  "name": "key",
7856
8128
  "description": null,
@@ -7987,6 +8259,42 @@
7987
8259
  "isDeprecated": false,
7988
8260
  "deprecationReason": null
7989
8261
  },
8262
+ {
8263
+ "name": "reversedAt",
8264
+ "description": "ISO-8601 timestamp of when this Ledger Line was reversed.",
8265
+ "args": [],
8266
+ "type": {
8267
+ "kind": "SCALAR",
8268
+ "name": "DateTime",
8269
+ "ofType": null
8270
+ },
8271
+ "isDeprecated": false,
8272
+ "deprecationReason": null
8273
+ },
8274
+ {
8275
+ "name": "reversedBy",
8276
+ "description": "The Ledger Line that reverses the balance changes of this Ledger Line.",
8277
+ "args": [],
8278
+ "type": {
8279
+ "kind": "OBJECT",
8280
+ "name": "LedgerLine",
8281
+ "ofType": null
8282
+ },
8283
+ "isDeprecated": false,
8284
+ "deprecationReason": null
8285
+ },
8286
+ {
8287
+ "name": "reverses",
8288
+ "description": "The Ledger Line whose balance changes are reversed by this Ledger Line.",
8289
+ "args": [],
8290
+ "type": {
8291
+ "kind": "OBJECT",
8292
+ "name": "LedgerLine",
8293
+ "ofType": null
8294
+ },
8295
+ "isDeprecated": false,
8296
+ "deprecationReason": null
8297
+ },
7990
8298
  {
7991
8299
  "name": "tx",
7992
8300
  "description": "The transaction linked to this LedgerLine",
@@ -8249,6 +8557,26 @@
8249
8557
  },
8250
8558
  "defaultValue": null
8251
8559
  },
8560
+ {
8561
+ "name": "isReversal",
8562
+ "description": "Use this to filter Ledger Lines that were posted to this Ledger Account, using `reverseLedgerEntry`.",
8563
+ "type": {
8564
+ "kind": "SCALAR",
8565
+ "name": "Boolean",
8566
+ "ofType": null
8567
+ },
8568
+ "defaultValue": null
8569
+ },
8570
+ {
8571
+ "name": "isReversed",
8572
+ "description": "Use this to filter Ledger Lines that have been reversed.",
8573
+ "type": {
8574
+ "kind": "SCALAR",
8575
+ "name": "Boolean",
8576
+ "ofType": null
8577
+ },
8578
+ "defaultValue": null
8579
+ },
8252
8580
  {
8253
8581
  "name": "key",
8254
8582
  "description": "Use this to filter Ledger Lines by key. Ledger Line keys are defined in Schemas.",
@@ -8269,6 +8597,16 @@
8269
8597
  },
8270
8598
  "defaultValue": null
8271
8599
  },
8600
+ {
8601
+ "name": "showHidden",
8602
+ "description": "Use this filter to find hidden Ledger Lines.",
8603
+ "type": {
8604
+ "kind": "SCALAR",
8605
+ "name": "Boolean",
8606
+ "ofType": null
8607
+ },
8608
+ "defaultValue": null
8609
+ },
8272
8610
  {
8273
8611
  "name": "type",
8274
8612
  "description": null,
@@ -9229,6 +9567,37 @@
9229
9567
  "isDeprecated": false,
9230
9568
  "deprecationReason": null
9231
9569
  },
9570
+ {
9571
+ "name": "reverseLedgerEntry",
9572
+ "description": "*EXPERIMENTAL* Reverses a ledger entry",
9573
+ "args": [
9574
+ {
9575
+ "name": "id",
9576
+ "description": "The ID of the Ledger Entry to reverse",
9577
+ "type": {
9578
+ "kind": "NON_NULL",
9579
+ "name": null,
9580
+ "ofType": {
9581
+ "kind": "SCALAR",
9582
+ "name": "ID",
9583
+ "ofType": null
9584
+ }
9585
+ },
9586
+ "defaultValue": null
9587
+ }
9588
+ ],
9589
+ "type": {
9590
+ "kind": "NON_NULL",
9591
+ "name": null,
9592
+ "ofType": {
9593
+ "kind": "UNION",
9594
+ "name": "ReverseLedgerEntryResponse",
9595
+ "ofType": null
9596
+ }
9597
+ },
9598
+ "isDeprecated": false,
9599
+ "deprecationReason": null
9600
+ },
9232
9601
  {
9233
9602
  "name": "storeSchema",
9234
9603
  "description": "Stores a Schema in your workspace. If no Schema with the same key exists in your worksapce, a new Schema is created.\nElse, the Schema is updated, and every Ledger associated with it is migrated to the latest version.",
@@ -9813,6 +10182,37 @@
9813
10182
  "isDeprecated": false,
9814
10183
  "deprecationReason": null
9815
10184
  },
10185
+ {
10186
+ "name": "ledgerEntryHistory",
10187
+ "description": "Get the reversal history of a Ledger Entry.",
10188
+ "args": [
10189
+ {
10190
+ "name": "ledgerEntry",
10191
+ "description": "An object specifying the ID or IK of the Ledger Entry's reversal history to query.",
10192
+ "type": {
10193
+ "kind": "NON_NULL",
10194
+ "name": null,
10195
+ "ofType": {
10196
+ "kind": "INPUT_OBJECT",
10197
+ "name": "LedgerEntryMatchInput",
10198
+ "ofType": null
10199
+ }
10200
+ },
10201
+ "defaultValue": null
10202
+ }
10203
+ ],
10204
+ "type": {
10205
+ "kind": "NON_NULL",
10206
+ "name": null,
10207
+ "ofType": {
10208
+ "kind": "OBJECT",
10209
+ "name": "LedgerEntriesConnection",
10210
+ "ofType": null
10211
+ }
10212
+ },
10213
+ "isDeprecated": false,
10214
+ "deprecationReason": null
10215
+ },
9816
10216
  {
9817
10217
  "name": "ledgerLine",
9818
10218
  "description": "Get LedgerLine by ID",
@@ -10205,6 +10605,91 @@
10205
10605
  "enumValues": null,
10206
10606
  "possibleTypes": null
10207
10607
  },
10608
+ {
10609
+ "kind": "UNION",
10610
+ "name": "ReverseLedgerEntryResponse",
10611
+ "description": null,
10612
+ "fields": null,
10613
+ "inputFields": null,
10614
+ "interfaces": null,
10615
+ "enumValues": null,
10616
+ "possibleTypes": [
10617
+ {
10618
+ "kind": "OBJECT",
10619
+ "name": "BadRequestError",
10620
+ "ofType": null
10621
+ },
10622
+ {
10623
+ "kind": "OBJECT",
10624
+ "name": "InternalError",
10625
+ "ofType": null
10626
+ },
10627
+ {
10628
+ "kind": "OBJECT",
10629
+ "name": "ReverseLedgerEntryResult",
10630
+ "ofType": null
10631
+ }
10632
+ ]
10633
+ },
10634
+ {
10635
+ "kind": "OBJECT",
10636
+ "name": "ReverseLedgerEntryResult",
10637
+ "description": null,
10638
+ "fields": [
10639
+ {
10640
+ "name": "isIkReplay",
10641
+ "description": "Whether the reversal was an IK replay",
10642
+ "args": [],
10643
+ "type": {
10644
+ "kind": "NON_NULL",
10645
+ "name": null,
10646
+ "ofType": {
10647
+ "kind": "SCALAR",
10648
+ "name": "Boolean",
10649
+ "ofType": null
10650
+ }
10651
+ },
10652
+ "isDeprecated": false,
10653
+ "deprecationReason": null
10654
+ },
10655
+ {
10656
+ "name": "reversedLedgerEntry",
10657
+ "description": "The Ledger Entry that was reversed",
10658
+ "args": [],
10659
+ "type": {
10660
+ "kind": "NON_NULL",
10661
+ "name": null,
10662
+ "ofType": {
10663
+ "kind": "OBJECT",
10664
+ "name": "LedgerEntry",
10665
+ "ofType": null
10666
+ }
10667
+ },
10668
+ "isDeprecated": false,
10669
+ "deprecationReason": null
10670
+ },
10671
+ {
10672
+ "name": "reversingLedgerEntry",
10673
+ "description": "The reversal Ledger Entry that was created",
10674
+ "args": [],
10675
+ "type": {
10676
+ "kind": "NON_NULL",
10677
+ "name": null,
10678
+ "ofType": {
10679
+ "kind": "OBJECT",
10680
+ "name": "LedgerEntry",
10681
+ "ofType": null
10682
+ }
10683
+ },
10684
+ "isDeprecated": false,
10685
+ "deprecationReason": null
10686
+ }
10687
+ ],
10688
+ "inputFields": null,
10689
+ "interfaces": [],
10690
+ "enumValues": null,
10691
+ "possibleTypes": null
10692
+ },
10208
10693
  {
10209
10694
  "kind": "SCALAR",
10210
10695
  "name": "SafeString",
@@ -11655,6 +12140,34 @@
11655
12140
  }
11656
12141
  },
11657
12142
  "defaultValue": null
12143
+ },
12144
+ {
12145
+ "name": "notEqualTo",
12146
+ "description": "Must not equal this string value",
12147
+ "type": {
12148
+ "kind": "SCALAR",
12149
+ "name": "String",
12150
+ "ofType": null
12151
+ },
12152
+ "defaultValue": null
12153
+ },
12154
+ {
12155
+ "name": "notIn",
12156
+ "description": "Must not match any of the values provided. Limited to 100 items maximum.",
12157
+ "type": {
12158
+ "kind": "LIST",
12159
+ "name": null,
12160
+ "ofType": {
12161
+ "kind": "NON_NULL",
12162
+ "name": null,
12163
+ "ofType": {
12164
+ "kind": "SCALAR",
12165
+ "name": "String",
12166
+ "ofType": null
12167
+ }
12168
+ }
12169
+ },
12170
+ "defaultValue": null
11658
12171
  }
11659
12172
  ],
11660
12173
  "interfaces": null,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FragmentSDK
4
- VERSION = '1.1.9'
4
+ VERSION = '1.1.11'
5
5
  end
@@ -8,24 +8,23 @@ require 'sorbet-runtime'
8
8
  require 'uri'
9
9
  require 'net/http'
10
10
  require 'fragment_client/version'
11
-
12
- module GraphQL
13
- module StaticValidation
14
- class LiteralValidator
15
- alias recursive_validate_old recursively_validate
16
- def recursively_validate(ast_value, type)
17
- res = catch(:invalid) do
18
- recursive_validate_old(ast_value, type)
19
- end
20
- if !res.valid? && type.kind.scalar? && ast_value.is_a?(GraphQL::Language::Nodes::InputObject)
21
- maybe_raise_if_invalid(ast_value) do
22
- ['JSON', 'JSONObject', 'Any'].include?(type.graphql_name) ? @valid_response : @invalid_response
23
- end
24
- else
25
- res
26
- end
27
- end
28
- end
11
+ module GraphQL
12
+ module StaticValidation
13
+ class LiteralValidator
14
+ alias recursive_validate_old recursively_validate
15
+ def recursively_validate(ast_value, type)
16
+ res = catch(:invalid) do
17
+ recursive_validate_old(ast_value, type)
18
+ end
19
+ if !res.valid? && type.kind.scalar? && ast_value.is_a?(GraphQL::Language::Nodes::InputObject)
20
+ maybe_raise_if_invalid(ast_value) do
21
+ %w[JSON JSONObject Any].include?(type.graphql_name) ? @valid_response : @invalid_response
22
+ end
23
+ else
24
+ res
25
+ end
26
+ end
27
+ end
29
28
  end
30
29
  end
31
30
 
@@ -64,9 +63,12 @@ module FragmentGraphQl
64
63
  # Use our custom client instead of the base GraphQL::Client
65
64
  Client = T.let(CustomClient.new(schema: FragmentSchema, execute: HTTP), CustomClient)
66
65
 
67
- FragmentQueries = T.let(Client.parse(
68
- File.read("#{__dir__}/queries.graphql")
69
- ), T.untyped)
66
+ def self.parse_queries(filename)
67
+ file_text = File.read(filename)
68
+ Client.parse(file_text)
69
+ end
70
+
71
+ FragmentQueries = T.let(parse_queries("#{__dir__}/queries.graphql"), T.untyped)
70
72
  end
71
73
 
72
74
  # A client for Fragment
@@ -96,9 +98,9 @@ class FragmentClient
96
98
 
97
99
  @client = T.let(
98
100
  FragmentGraphQl::CustomClient.new(
99
- schema: FragmentGraphQl::FragmentSchema,
101
+ schema: FragmentGraphQl::FragmentSchema,
100
102
  execute: @execute
101
- ),
103
+ ),
102
104
  FragmentGraphQl::CustomClient
103
105
  )
104
106
  @token = T.let(create_token, Token)
@@ -107,9 +109,7 @@ class FragmentClient
107
109
  return if extra_queries_filenames.nil?
108
110
 
109
111
  extra_queries_filenames.each do |filename|
110
- queries = @client.parse(
111
- File.read(filename)
112
- )
112
+ queries = T.let(FragmentGraphQl.parse_queries(filename), T.untyped)
113
113
  define_method_from_queries(queries)
114
114
  end
115
115
  end
@@ -133,8 +133,30 @@ class FragmentClient
133
133
  name = qry.to_s.gsub(/[a-z]([A-Z])/) do |m|
134
134
  format('%<lower>s_%<upper>s', lower: m[0], upper: m[1].downcase)
135
135
  end.gsub(/^[A-Z]/, &:downcase)
136
+
137
+ # Get the original query
138
+ original_query = queries.const_get(qry)
139
+
140
+ # Create a monkey-patched version of the definition_node for this specific instance
141
+ # This avoids changing the class type while still modifying the behavior
142
+ if original_query.respond_to?(:definition_node)
143
+ definition_node = original_query.definition_node
144
+
145
+ # Only patch once to avoid infinite recursion
146
+ unless definition_node.singleton_class.method_defined?(:original_name)
147
+ # Store the original method
148
+ definition_node.singleton_class.send(:alias_method, :original_name, :name)
149
+
150
+ # Define the new method that uses the stored original method
151
+ definition_node.singleton_class.send(:define_method, :name) do
152
+ original_name.gsub(/#<Module.*?>/, 'FragmentGraphQl__Dynamic__Custom')
153
+ end
154
+ end
155
+ end
156
+
157
+ # Define the method with the original query (which now has patched behavior)
136
158
  define_singleton_method(name) do |v|
137
- query(queries.const_get(qry), v)
159
+ query(original_query, v)
138
160
  end
139
161
  end
140
162
  end
@@ -176,6 +198,7 @@ class FragmentClient
176
198
 
177
199
  sig { returns(Integer) }
178
200
  attr_accessor :token_expiry_buffer
201
+
179
202
  sig { returns(Logger) }
180
203
  attr_accessor :logger
181
204
 
@@ -208,6 +231,7 @@ class FragmentClient
208
231
  sig { void }
209
232
  def refresh_token_if_needed
210
233
  return unless token_expired?
234
+
211
235
  @token = create_token
212
236
  end
213
237
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fragment-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - fragment
@@ -13,16 +13,22 @@ dependencies:
13
13
  name: graphql
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: 2.2.5
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.5.0
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
24
27
  - !ruby/object:Gem::Version
25
28
  version: 2.2.5
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 2.5.0
26
32
  - !ruby/object:Gem::Dependency
27
33
  name: graphql-client
28
34
  requirement: !ruby/object:Gem::Requirement