fragment-dev 1.1.3 → 1.1.5
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 +4 -4
- data/lib/fragment.schema.json +541 -99
- data/lib/fragment_client/version.rb +1 -1
- data/lib/fragment_client.rb +98 -34
- data/lib/queries.graphql +46 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14ed3fb9c939a656c86ce4ce587c6e778302ba33e112e6d8363fc2ed8a791ee0
|
4
|
+
data.tar.gz: 61f1af6ee1cff1309ad207ff9bcfe0ae07a4903e17fd8cf025a111dda7bdc0f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f9acc9a93ef576b8358fa082df9f2a38afd716b0b0ad1cb429469761e3ef7090f57c5fe0ae8db8535f6c8abe147fc442e82db99058ff989cb4a3041f497a308
|
7
|
+
data.tar.gz: 400e3b64573ac550667baf79edec6e53452c05cc489fc7d3613063ccbf69bd6ab08b9005d4b069d5b8f09d0b3185085d05b013b78a222cc5a2f8fd42a66924e3
|
data/lib/fragment.schema.json
CHANGED
@@ -184,20 +184,20 @@
|
|
184
184
|
{
|
185
185
|
"kind": "ENUM",
|
186
186
|
"name": "BalanceUpdateConsistencyMode",
|
187
|
-
"description": "Used to configure the write-consistency of a Ledger Account's balance
|
187
|
+
"description": "Used to configure the write-consistency of a Ledger Account's balance. See [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
188
188
|
"fields": null,
|
189
189
|
"inputFields": null,
|
190
190
|
"interfaces": null,
|
191
191
|
"enumValues": [
|
192
192
|
{
|
193
193
|
"name": "eventual",
|
194
|
-
"description":
|
194
|
+
"description": null,
|
195
195
|
"isDeprecated": false,
|
196
196
|
"deprecationReason": null
|
197
197
|
},
|
198
198
|
{
|
199
199
|
"name": "strong",
|
200
|
-
"description":
|
200
|
+
"description": null,
|
201
201
|
"isDeprecated": false,
|
202
202
|
"deprecationReason": null
|
203
203
|
}
|
@@ -460,8 +460,8 @@
|
|
460
460
|
"kind": "NON_NULL",
|
461
461
|
"name": null,
|
462
462
|
"ofType": {
|
463
|
-
"kind": "
|
464
|
-
"name": "
|
463
|
+
"kind": "OBJECT",
|
464
|
+
"name": "CustomLink",
|
465
465
|
"ofType": null
|
466
466
|
}
|
467
467
|
},
|
@@ -1120,15 +1120,19 @@
|
|
1120
1120
|
|
1121
1121
|
],
|
1122
1122
|
"type": {
|
1123
|
-
"kind": "
|
1123
|
+
"kind": "NON_NULL",
|
1124
1124
|
"name": null,
|
1125
1125
|
"ofType": {
|
1126
|
-
"kind": "
|
1126
|
+
"kind": "LIST",
|
1127
1127
|
"name": null,
|
1128
1128
|
"ofType": {
|
1129
|
-
"kind": "
|
1130
|
-
"name":
|
1131
|
-
"ofType":
|
1129
|
+
"kind": "NON_NULL",
|
1130
|
+
"name": null,
|
1131
|
+
"ofType": {
|
1132
|
+
"kind": "OBJECT",
|
1133
|
+
"name": "CurrencyAmount",
|
1134
|
+
"ofType": null
|
1135
|
+
}
|
1132
1136
|
}
|
1133
1137
|
}
|
1134
1138
|
},
|
@@ -2723,6 +2727,120 @@
|
|
2723
2727
|
"enumValues": null,
|
2724
2728
|
"possibleTypes": null
|
2725
2729
|
},
|
2730
|
+
{
|
2731
|
+
"kind": "UNION",
|
2732
|
+
"name": "DeleteLedgerResponse",
|
2733
|
+
"description": null,
|
2734
|
+
"fields": null,
|
2735
|
+
"inputFields": null,
|
2736
|
+
"interfaces": null,
|
2737
|
+
"enumValues": null,
|
2738
|
+
"possibleTypes": [
|
2739
|
+
{
|
2740
|
+
"kind": "OBJECT",
|
2741
|
+
"name": "BadRequestError",
|
2742
|
+
"ofType": null
|
2743
|
+
},
|
2744
|
+
{
|
2745
|
+
"kind": "OBJECT",
|
2746
|
+
"name": "DeleteLedgerResult",
|
2747
|
+
"ofType": null
|
2748
|
+
},
|
2749
|
+
{
|
2750
|
+
"kind": "OBJECT",
|
2751
|
+
"name": "InternalError",
|
2752
|
+
"ofType": null
|
2753
|
+
}
|
2754
|
+
]
|
2755
|
+
},
|
2756
|
+
{
|
2757
|
+
"kind": "OBJECT",
|
2758
|
+
"name": "DeleteLedgerResult",
|
2759
|
+
"description": null,
|
2760
|
+
"fields": [
|
2761
|
+
{
|
2762
|
+
"name": "success",
|
2763
|
+
"description": null,
|
2764
|
+
"args": [
|
2765
|
+
|
2766
|
+
],
|
2767
|
+
"type": {
|
2768
|
+
"kind": "NON_NULL",
|
2769
|
+
"name": null,
|
2770
|
+
"ofType": {
|
2771
|
+
"kind": "SCALAR",
|
2772
|
+
"name": "Boolean",
|
2773
|
+
"ofType": null
|
2774
|
+
}
|
2775
|
+
},
|
2776
|
+
"isDeprecated": false,
|
2777
|
+
"deprecationReason": null
|
2778
|
+
}
|
2779
|
+
],
|
2780
|
+
"inputFields": null,
|
2781
|
+
"interfaces": [
|
2782
|
+
|
2783
|
+
],
|
2784
|
+
"enumValues": null,
|
2785
|
+
"possibleTypes": null
|
2786
|
+
},
|
2787
|
+
{
|
2788
|
+
"kind": "UNION",
|
2789
|
+
"name": "DeleteSchemaResponse",
|
2790
|
+
"description": null,
|
2791
|
+
"fields": null,
|
2792
|
+
"inputFields": null,
|
2793
|
+
"interfaces": null,
|
2794
|
+
"enumValues": null,
|
2795
|
+
"possibleTypes": [
|
2796
|
+
{
|
2797
|
+
"kind": "OBJECT",
|
2798
|
+
"name": "BadRequestError",
|
2799
|
+
"ofType": null
|
2800
|
+
},
|
2801
|
+
{
|
2802
|
+
"kind": "OBJECT",
|
2803
|
+
"name": "DeleteSchemaResult",
|
2804
|
+
"ofType": null
|
2805
|
+
},
|
2806
|
+
{
|
2807
|
+
"kind": "OBJECT",
|
2808
|
+
"name": "InternalError",
|
2809
|
+
"ofType": null
|
2810
|
+
}
|
2811
|
+
]
|
2812
|
+
},
|
2813
|
+
{
|
2814
|
+
"kind": "OBJECT",
|
2815
|
+
"name": "DeleteSchemaResult",
|
2816
|
+
"description": null,
|
2817
|
+
"fields": [
|
2818
|
+
{
|
2819
|
+
"name": "success",
|
2820
|
+
"description": null,
|
2821
|
+
"args": [
|
2822
|
+
|
2823
|
+
],
|
2824
|
+
"type": {
|
2825
|
+
"kind": "NON_NULL",
|
2826
|
+
"name": null,
|
2827
|
+
"ofType": {
|
2828
|
+
"kind": "SCALAR",
|
2829
|
+
"name": "Boolean",
|
2830
|
+
"ofType": null
|
2831
|
+
}
|
2832
|
+
},
|
2833
|
+
"isDeprecated": false,
|
2834
|
+
"deprecationReason": null
|
2835
|
+
}
|
2836
|
+
],
|
2837
|
+
"inputFields": null,
|
2838
|
+
"interfaces": [
|
2839
|
+
|
2840
|
+
],
|
2841
|
+
"enumValues": null,
|
2842
|
+
"possibleTypes": null
|
2843
|
+
},
|
2726
2844
|
{
|
2727
2845
|
"kind": "INPUT_OBJECT",
|
2728
2846
|
"name": "EntryGroupMatchInput",
|
@@ -2964,9 +3082,13 @@
|
|
2964
3082
|
}
|
2965
3083
|
],
|
2966
3084
|
"type": {
|
2967
|
-
"kind": "
|
2968
|
-
"name":
|
2969
|
-
"ofType":
|
3085
|
+
"kind": "NON_NULL",
|
3086
|
+
"name": null,
|
3087
|
+
"ofType": {
|
3088
|
+
"kind": "OBJECT",
|
3089
|
+
"name": "LedgerAccountsConnection",
|
3090
|
+
"ofType": null
|
3091
|
+
}
|
2970
3092
|
},
|
2971
3093
|
"isDeprecated": false,
|
2972
3094
|
"deprecationReason": null
|
@@ -3132,7 +3254,7 @@
|
|
3132
3254
|
{
|
3133
3255
|
"kind": "INPUT_OBJECT",
|
3134
3256
|
"name": "ExternalAccountMatchInput",
|
3135
|
-
"description": "Specify an External Account by using `id`, or
|
3257
|
+
"description": "Specify an External Account by using `id`, or `linkId` and `externalId`.",
|
3136
3258
|
"fields": null,
|
3137
3259
|
"inputFields": [
|
3138
3260
|
{
|
@@ -3915,9 +4037,13 @@
|
|
3915
4037
|
}
|
3916
4038
|
],
|
3917
4039
|
"type": {
|
3918
|
-
"kind": "
|
3919
|
-
"name":
|
3920
|
-
"ofType":
|
4040
|
+
"kind": "NON_NULL",
|
4041
|
+
"name": null,
|
4042
|
+
"ofType": {
|
4043
|
+
"kind": "OBJECT",
|
4044
|
+
"name": "LedgerAccountsConnection",
|
4045
|
+
"ofType": null
|
4046
|
+
}
|
3921
4047
|
},
|
3922
4048
|
"isDeprecated": false,
|
3923
4049
|
"deprecationReason": null
|
@@ -3978,9 +4104,13 @@
|
|
3978
4104
|
}
|
3979
4105
|
],
|
3980
4106
|
"type": {
|
3981
|
-
"kind": "
|
3982
|
-
"name":
|
3983
|
-
"ofType":
|
4107
|
+
"kind": "NON_NULL",
|
4108
|
+
"name": null,
|
4109
|
+
"ofType": {
|
4110
|
+
"kind": "OBJECT",
|
4111
|
+
"name": "LedgerEntriesConnection",
|
4112
|
+
"ofType": null
|
4113
|
+
}
|
3984
4114
|
},
|
3985
4115
|
"isDeprecated": false,
|
3986
4116
|
"deprecationReason": null
|
@@ -4072,9 +4202,13 @@
|
|
4072
4202
|
}
|
4073
4203
|
],
|
4074
4204
|
"type": {
|
4075
|
-
"kind": "
|
4076
|
-
"name":
|
4077
|
-
"ofType":
|
4205
|
+
"kind": "NON_NULL",
|
4206
|
+
"name": null,
|
4207
|
+
"ofType": {
|
4208
|
+
"kind": "OBJECT",
|
4209
|
+
"name": "LedgerEntryGroupsConnection",
|
4210
|
+
"ofType": null
|
4211
|
+
}
|
4078
4212
|
},
|
4079
4213
|
"isDeprecated": false,
|
4080
4214
|
"deprecationReason": null
|
@@ -4086,9 +4220,13 @@
|
|
4086
4220
|
|
4087
4221
|
],
|
4088
4222
|
"type": {
|
4089
|
-
"kind": "
|
4090
|
-
"name":
|
4091
|
-
"ofType":
|
4223
|
+
"kind": "NON_NULL",
|
4224
|
+
"name": null,
|
4225
|
+
"ofType": {
|
4226
|
+
"kind": "OBJECT",
|
4227
|
+
"name": "LedgerMigrationConnection",
|
4228
|
+
"ofType": null
|
4229
|
+
}
|
4092
4230
|
},
|
4093
4231
|
"isDeprecated": false,
|
4094
4232
|
"deprecationReason": null
|
@@ -5036,9 +5174,13 @@
|
|
5036
5174
|
}
|
5037
5175
|
],
|
5038
5176
|
"type": {
|
5039
|
-
"kind": "
|
5040
|
-
"name":
|
5041
|
-
"ofType":
|
5177
|
+
"kind": "NON_NULL",
|
5178
|
+
"name": null,
|
5179
|
+
"ofType": {
|
5180
|
+
"kind": "OBJECT",
|
5181
|
+
"name": "TxsConnection",
|
5182
|
+
"ofType": null
|
5183
|
+
}
|
5042
5184
|
},
|
5043
5185
|
"isDeprecated": false,
|
5044
5186
|
"deprecationReason": null
|
@@ -5176,9 +5318,27 @@
|
|
5176
5318
|
"description": "The payload configuring the consistency for this Ledger Account.\nSee [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
5177
5319
|
"fields": null,
|
5178
5320
|
"inputFields": [
|
5321
|
+
{
|
5322
|
+
"name": "groups",
|
5323
|
+
"description": "The consistency configuration for Ledger Entry Groups affecting this account.\n\nSee [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
5324
|
+
"type": {
|
5325
|
+
"kind": "LIST",
|
5326
|
+
"name": null,
|
5327
|
+
"ofType": {
|
5328
|
+
"kind": "NON_NULL",
|
5329
|
+
"name": null,
|
5330
|
+
"ofType": {
|
5331
|
+
"kind": "INPUT_OBJECT",
|
5332
|
+
"name": "LedgerAccountGroupConsistencyConfigInput",
|
5333
|
+
"ofType": null
|
5334
|
+
}
|
5335
|
+
}
|
5336
|
+
},
|
5337
|
+
"defaultValue": null
|
5338
|
+
},
|
5179
5339
|
{
|
5180
5340
|
"name": "lines",
|
5181
|
-
"description": "If set to `strong`, then a Ledger Account's `lines` updates will be strongly consistent with
|
5341
|
+
"description": "If set to `strong`, then a Ledger Account's `lines` updates will be strongly consistent with the API response.\nThis Ledger Account's balance will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, `lines` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
5182
5342
|
"type": {
|
5183
5343
|
"kind": "ENUM",
|
5184
5344
|
"name": "LedgerLinesConsistencyMode",
|
@@ -5188,7 +5348,7 @@
|
|
5188
5348
|
},
|
5189
5349
|
{
|
5190
5350
|
"name": "ownBalanceUpdates",
|
5191
|
-
"description": "If set to `strong`, then a Ledger Account's `ownBalance` updates will be strongly consistent with
|
5351
|
+
"description": "If set to `strong`, then a Ledger Account's `ownBalance` updates will be strongly consistent with the API response.\nThis Ledger Account's balance will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, `ownBalance` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
5192
5352
|
"type": {
|
5193
5353
|
"kind": "ENUM",
|
5194
5354
|
"name": "BalanceUpdateConsistencyMode",
|
@@ -5240,6 +5400,45 @@
|
|
5240
5400
|
"enumValues": null,
|
5241
5401
|
"possibleTypes": null
|
5242
5402
|
},
|
5403
|
+
{
|
5404
|
+
"kind": "INPUT_OBJECT",
|
5405
|
+
"name": "LedgerAccountGroupConsistencyConfigInput",
|
5406
|
+
"description": "The consistency configuration for a specific Ledger Entry Group in this account.",
|
5407
|
+
"fields": null,
|
5408
|
+
"inputFields": [
|
5409
|
+
{
|
5410
|
+
"name": "key",
|
5411
|
+
"description": "The group key for this configuration.",
|
5412
|
+
"type": {
|
5413
|
+
"kind": "NON_NULL",
|
5414
|
+
"name": null,
|
5415
|
+
"ofType": {
|
5416
|
+
"kind": "SCALAR",
|
5417
|
+
"name": "String",
|
5418
|
+
"ofType": null
|
5419
|
+
}
|
5420
|
+
},
|
5421
|
+
"defaultValue": null
|
5422
|
+
},
|
5423
|
+
{
|
5424
|
+
"name": "ownBalanceUpdates",
|
5425
|
+
"description": "If set to `strong`, then Ledger Entry Group `ownBalance`s updates for this account will be strongly consistent with the API response.\nThis Ledger Account's Ledger Entry Group balances will be updated and available for strongly consistent reads before you receive an API response.\n\nOtherwise if unset or set to `eventual`, Ledger Entry Group `ownBalance` updates are applied asynchronously and may not be immediately reflected in queries.\n\nSee [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
5426
|
+
"type": {
|
5427
|
+
"kind": "NON_NULL",
|
5428
|
+
"name": null,
|
5429
|
+
"ofType": {
|
5430
|
+
"kind": "ENUM",
|
5431
|
+
"name": "BalanceUpdateConsistencyMode",
|
5432
|
+
"ofType": null
|
5433
|
+
}
|
5434
|
+
},
|
5435
|
+
"defaultValue": null
|
5436
|
+
}
|
5437
|
+
],
|
5438
|
+
"interfaces": null,
|
5439
|
+
"enumValues": null,
|
5440
|
+
"possibleTypes": null
|
5441
|
+
},
|
5243
5442
|
{
|
5244
5443
|
"kind": "INPUT_OBJECT",
|
5245
5444
|
"name": "LedgerAccountMatchInput",
|
@@ -5248,7 +5447,7 @@
|
|
5248
5447
|
"inputFields": [
|
5249
5448
|
{
|
5250
5449
|
"name": "id",
|
5251
|
-
"description": "The FRAGMENT ID of the
|
5450
|
+
"description": "The FRAGMENT ID of the Ledger Account",
|
5252
5451
|
"type": {
|
5253
5452
|
"kind": "SCALAR",
|
5254
5453
|
"name": "ID",
|
@@ -5268,7 +5467,7 @@
|
|
5268
5467
|
},
|
5269
5468
|
{
|
5270
5469
|
"name": "path",
|
5271
|
-
"description": "The unique path of the
|
5470
|
+
"description": "The unique path of the Ledger Account.\nThis is a slash-delimited string containing the keys of an account and all its direct ancestors.",
|
5272
5471
|
"type": {
|
5273
5472
|
"kind": "SCALAR",
|
5274
5473
|
"name": "String",
|
@@ -5367,15 +5566,19 @@
|
|
5367
5566
|
|
5368
5567
|
],
|
5369
5568
|
"type": {
|
5370
|
-
"kind": "
|
5569
|
+
"kind": "NON_NULL",
|
5371
5570
|
"name": null,
|
5372
5571
|
"ofType": {
|
5373
|
-
"kind": "
|
5572
|
+
"kind": "LIST",
|
5374
5573
|
"name": null,
|
5375
5574
|
"ofType": {
|
5376
|
-
"kind": "
|
5377
|
-
"name":
|
5378
|
-
"ofType":
|
5575
|
+
"kind": "NON_NULL",
|
5576
|
+
"name": null,
|
5577
|
+
"ofType": {
|
5578
|
+
"kind": "OBJECT",
|
5579
|
+
"name": "LedgerAccount",
|
5580
|
+
"ofType": null
|
5581
|
+
}
|
5379
5582
|
}
|
5380
5583
|
}
|
5381
5584
|
},
|
@@ -5501,15 +5704,19 @@
|
|
5501
5704
|
|
5502
5705
|
],
|
5503
5706
|
"type": {
|
5504
|
-
"kind": "
|
5707
|
+
"kind": "NON_NULL",
|
5505
5708
|
"name": null,
|
5506
5709
|
"ofType": {
|
5507
|
-
"kind": "
|
5710
|
+
"kind": "LIST",
|
5508
5711
|
"name": null,
|
5509
5712
|
"ofType": {
|
5510
|
-
"kind": "
|
5511
|
-
"name":
|
5512
|
-
"ofType":
|
5713
|
+
"kind": "NON_NULL",
|
5714
|
+
"name": null,
|
5715
|
+
"ofType": {
|
5716
|
+
"kind": "OBJECT",
|
5717
|
+
"name": "LedgerEntry",
|
5718
|
+
"ofType": null
|
5719
|
+
}
|
5513
5720
|
}
|
5514
5721
|
}
|
5515
5722
|
},
|
@@ -5818,6 +6025,20 @@
|
|
5818
6025
|
"isDeprecated": false,
|
5819
6026
|
"deprecationReason": null
|
5820
6027
|
},
|
6028
|
+
{
|
6029
|
+
"name": "parameters",
|
6030
|
+
"description": "The parameters used to post this Ledger Entry.",
|
6031
|
+
"args": [
|
6032
|
+
|
6033
|
+
],
|
6034
|
+
"type": {
|
6035
|
+
"kind": "SCALAR",
|
6036
|
+
"name": "Parameters",
|
6037
|
+
"ofType": null
|
6038
|
+
},
|
6039
|
+
"isDeprecated": false,
|
6040
|
+
"deprecationReason": null
|
6041
|
+
},
|
5821
6042
|
{
|
5822
6043
|
"name": "posted",
|
5823
6044
|
"description": "ISO-8601 timestamp this LedgerEntry posted to its Ledger.",
|
@@ -6137,8 +6358,40 @@
|
|
6137
6358
|
"kind": "NON_NULL",
|
6138
6359
|
"name": null,
|
6139
6360
|
"ofType": {
|
6140
|
-
"kind": "OBJECT",
|
6141
|
-
"name": "LedgerEntryGroupBalanceConnection",
|
6361
|
+
"kind": "OBJECT",
|
6362
|
+
"name": "LedgerEntryGroupBalanceConnection",
|
6363
|
+
"ofType": null
|
6364
|
+
}
|
6365
|
+
},
|
6366
|
+
"isDeprecated": false,
|
6367
|
+
"deprecationReason": null
|
6368
|
+
},
|
6369
|
+
{
|
6370
|
+
"name": "created",
|
6371
|
+
"description": "ISO-8601 timestamp this LedgerEntryGroup was created in Fragment.",
|
6372
|
+
"args": [
|
6373
|
+
|
6374
|
+
],
|
6375
|
+
"type": {
|
6376
|
+
"kind": "SCALAR",
|
6377
|
+
"name": "DateTime",
|
6378
|
+
"ofType": null
|
6379
|
+
},
|
6380
|
+
"isDeprecated": false,
|
6381
|
+
"deprecationReason": null
|
6382
|
+
},
|
6383
|
+
{
|
6384
|
+
"name": "dashboardUrl",
|
6385
|
+
"description": "URL to the Fragment Dashboard for this Ledger Entry Group.",
|
6386
|
+
"args": [
|
6387
|
+
|
6388
|
+
],
|
6389
|
+
"type": {
|
6390
|
+
"kind": "NON_NULL",
|
6391
|
+
"name": null,
|
6392
|
+
"ofType": {
|
6393
|
+
"kind": "SCALAR",
|
6394
|
+
"name": "String",
|
6142
6395
|
"ofType": null
|
6143
6396
|
}
|
6144
6397
|
},
|
@@ -6146,22 +6399,26 @@
|
|
6146
6399
|
"deprecationReason": null
|
6147
6400
|
},
|
6148
6401
|
{
|
6149
|
-
"name": "
|
6150
|
-
"description": "
|
6402
|
+
"name": "key",
|
6403
|
+
"description": "The key of this Ledger Entry Group.",
|
6151
6404
|
"args": [
|
6152
6405
|
|
6153
6406
|
],
|
6154
6407
|
"type": {
|
6155
|
-
"kind": "
|
6156
|
-
"name":
|
6157
|
-
"ofType":
|
6408
|
+
"kind": "NON_NULL",
|
6409
|
+
"name": null,
|
6410
|
+
"ofType": {
|
6411
|
+
"kind": "SCALAR",
|
6412
|
+
"name": "SafeString",
|
6413
|
+
"ofType": null
|
6414
|
+
}
|
6158
6415
|
},
|
6159
6416
|
"isDeprecated": false,
|
6160
6417
|
"deprecationReason": null
|
6161
6418
|
},
|
6162
6419
|
{
|
6163
|
-
"name": "
|
6164
|
-
"description": "The
|
6420
|
+
"name": "ledger",
|
6421
|
+
"description": "The Ledger that this Ledger Entry Group is within.",
|
6165
6422
|
"args": [
|
6166
6423
|
|
6167
6424
|
],
|
@@ -6169,8 +6426,8 @@
|
|
6169
6426
|
"kind": "NON_NULL",
|
6170
6427
|
"name": null,
|
6171
6428
|
"ofType": {
|
6172
|
-
"kind": "
|
6173
|
-
"name": "
|
6429
|
+
"kind": "OBJECT",
|
6430
|
+
"name": "Ledger",
|
6174
6431
|
"ofType": null
|
6175
6432
|
}
|
6176
6433
|
},
|
@@ -6244,6 +6501,24 @@
|
|
6244
6501
|
"isDeprecated": false,
|
6245
6502
|
"deprecationReason": null
|
6246
6503
|
},
|
6504
|
+
{
|
6505
|
+
"name": "ledgerId",
|
6506
|
+
"description": "The ID of the Ledger this Ledger Entry Group is within.",
|
6507
|
+
"args": [
|
6508
|
+
|
6509
|
+
],
|
6510
|
+
"type": {
|
6511
|
+
"kind": "NON_NULL",
|
6512
|
+
"name": null,
|
6513
|
+
"ofType": {
|
6514
|
+
"kind": "SCALAR",
|
6515
|
+
"name": "ID",
|
6516
|
+
"ofType": null
|
6517
|
+
}
|
6518
|
+
},
|
6519
|
+
"isDeprecated": false,
|
6520
|
+
"deprecationReason": null
|
6521
|
+
},
|
6247
6522
|
{
|
6248
6523
|
"name": "value",
|
6249
6524
|
"description": "The value associated with Ledger Entry Group.",
|
@@ -6315,7 +6590,16 @@
|
|
6315
6590
|
"name": "ownBalance",
|
6316
6591
|
"description": "The total balance change for this Ledger Account and currency.",
|
6317
6592
|
"args": [
|
6318
|
-
|
6593
|
+
{
|
6594
|
+
"name": "consistencyMode",
|
6595
|
+
"description": "The consistency mode to use when fetching the balance. Use 'use_account' to match the configured consistency mode of the account.",
|
6596
|
+
"type": {
|
6597
|
+
"kind": "ENUM",
|
6598
|
+
"name": "ReadBalanceConsistencyMode",
|
6599
|
+
"ofType": null
|
6600
|
+
},
|
6601
|
+
"defaultValue": null
|
6602
|
+
}
|
6319
6603
|
],
|
6320
6604
|
"type": {
|
6321
6605
|
"kind": "NON_NULL",
|
@@ -6592,7 +6876,7 @@
|
|
6592
6876
|
"inputFields": [
|
6593
6877
|
{
|
6594
6878
|
"name": "created",
|
6595
|
-
"description": "Use to filter
|
6879
|
+
"description": "Use to filter Ledger Entry Groups by their created timestamp",
|
6596
6880
|
"type": {
|
6597
6881
|
"kind": "INPUT_OBJECT",
|
6598
6882
|
"name": "DateTimeFilter",
|
@@ -6602,7 +6886,17 @@
|
|
6602
6886
|
},
|
6603
6887
|
{
|
6604
6888
|
"name": "key",
|
6605
|
-
"description": "Use to filter
|
6889
|
+
"description": "Use to filter Ledger Entry Groups by their key",
|
6890
|
+
"type": {
|
6891
|
+
"kind": "INPUT_OBJECT",
|
6892
|
+
"name": "StringFilter",
|
6893
|
+
"ofType": null
|
6894
|
+
},
|
6895
|
+
"defaultValue": null
|
6896
|
+
},
|
6897
|
+
{
|
6898
|
+
"name": "value",
|
6899
|
+
"description": "Use to filter Ledger Entry Groups by their value",
|
6606
6900
|
"type": {
|
6607
6901
|
"kind": "INPUT_OBJECT",
|
6608
6902
|
"name": "StringFilter",
|
@@ -6742,6 +7036,16 @@
|
|
6742
7036
|
"ofType": null
|
6743
7037
|
},
|
6744
7038
|
"defaultValue": null
|
7039
|
+
},
|
7040
|
+
{
|
7041
|
+
"name": "version",
|
7042
|
+
"description": "Experimental: This field is reserved for an upcoming feature and is not yet supported.",
|
7043
|
+
"type": {
|
7044
|
+
"kind": "SCALAR",
|
7045
|
+
"name": "Int",
|
7046
|
+
"ofType": null
|
7047
|
+
},
|
7048
|
+
"defaultValue": null
|
6745
7049
|
}
|
6746
7050
|
],
|
6747
7051
|
"interfaces": null,
|
@@ -6766,7 +7070,7 @@
|
|
6766
7070
|
},
|
6767
7071
|
{
|
6768
7072
|
"name": "ik",
|
6769
|
-
"description": "The IK provided to the `addLedgerEntry` mutation or the `ik` field
|
7073
|
+
"description": "The IK provided to the `addLedgerEntry` mutation or the `ik` field returned from a `reconcileTx` mutation. This is required if you have not provided `id`.",
|
6770
7074
|
"type": {
|
6771
7075
|
"kind": "SCALAR",
|
6772
7076
|
"name": "SafeString",
|
@@ -6776,7 +7080,7 @@
|
|
6776
7080
|
},
|
6777
7081
|
{
|
6778
7082
|
"name": "ledger",
|
6779
|
-
"description": "The FRAGMENT ID of the Ledger to which this Ledger Entry belongs. This
|
7083
|
+
"description": "The FRAGMENT ID of the Ledger to which this Ledger Entry belongs. This is required if you have not provided `id`.",
|
6780
7084
|
"type": {
|
6781
7085
|
"kind": "INPUT_OBJECT",
|
6782
7086
|
"name": "LedgerMatchInput",
|
@@ -7393,15 +7697,19 @@
|
|
7393
7697
|
|
7394
7698
|
],
|
7395
7699
|
"type": {
|
7396
|
-
"kind": "
|
7700
|
+
"kind": "NON_NULL",
|
7397
7701
|
"name": null,
|
7398
7702
|
"ofType": {
|
7399
|
-
"kind": "
|
7703
|
+
"kind": "LIST",
|
7400
7704
|
"name": null,
|
7401
7705
|
"ofType": {
|
7402
|
-
"kind": "
|
7403
|
-
"name":
|
7404
|
-
"ofType":
|
7706
|
+
"kind": "NON_NULL",
|
7707
|
+
"name": null,
|
7708
|
+
"ofType": {
|
7709
|
+
"kind": "OBJECT",
|
7710
|
+
"name": "LedgerLine",
|
7711
|
+
"ofType": null
|
7712
|
+
}
|
7405
7713
|
}
|
7406
7714
|
}
|
7407
7715
|
},
|
@@ -7463,9 +7771,19 @@
|
|
7463
7771
|
"description": null,
|
7464
7772
|
"fields": null,
|
7465
7773
|
"inputFields": [
|
7774
|
+
{
|
7775
|
+
"name": "created",
|
7776
|
+
"description": "Filter by the created timestamp of the Ledger Line. This is the wall-clock time when the Ledger Line was created.",
|
7777
|
+
"type": {
|
7778
|
+
"kind": "INPUT_OBJECT",
|
7779
|
+
"name": "DateTimeFilter",
|
7780
|
+
"ofType": null
|
7781
|
+
},
|
7782
|
+
"defaultValue": null
|
7783
|
+
},
|
7466
7784
|
{
|
7467
7785
|
"name": "date",
|
7468
|
-
"description":
|
7786
|
+
"description": "Filter by the posted date of the Ledger Line. This is identical to using `posted`, but only supports day-level granularity.",
|
7469
7787
|
"type": {
|
7470
7788
|
"kind": "INPUT_OBJECT",
|
7471
7789
|
"name": "DateFilter",
|
@@ -7485,7 +7803,7 @@
|
|
7485
7803
|
},
|
7486
7804
|
{
|
7487
7805
|
"name": "posted",
|
7488
|
-
"description":
|
7806
|
+
"description": "Filter by the posted timestamp of the Ledger Line.",
|
7489
7807
|
"type": {
|
7490
7808
|
"kind": "INPUT_OBJECT",
|
7491
7809
|
"name": "DateTimeFilter",
|
@@ -7516,7 +7834,7 @@
|
|
7516
7834
|
"inputFields": [
|
7517
7835
|
{
|
7518
7836
|
"name": "id",
|
7519
|
-
"description": "The FRAGMENT ID of the
|
7837
|
+
"description": "The FRAGMENT ID of the Ledger",
|
7520
7838
|
"type": {
|
7521
7839
|
"kind": "SCALAR",
|
7522
7840
|
"name": "ID",
|
@@ -7526,7 +7844,7 @@
|
|
7526
7844
|
},
|
7527
7845
|
{
|
7528
7846
|
"name": "ik",
|
7529
|
-
"description": "The IK passed into the [createLedger](/api-reference#mutations-createledger) mutation. This is treated as a second unique identifier for this
|
7847
|
+
"description": "The IK passed into the [createLedger](/api-reference#mutations-createledger) mutation. This is treated as a second unique identifier for this Ledger.",
|
7530
7848
|
"type": {
|
7531
7849
|
"kind": "SCALAR",
|
7532
7850
|
"name": "SafeString",
|
@@ -7772,15 +8090,19 @@
|
|
7772
8090
|
|
7773
8091
|
],
|
7774
8092
|
"type": {
|
7775
|
-
"kind": "
|
8093
|
+
"kind": "NON_NULL",
|
7776
8094
|
"name": null,
|
7777
8095
|
"ofType": {
|
7778
|
-
"kind": "
|
8096
|
+
"kind": "LIST",
|
7779
8097
|
"name": null,
|
7780
8098
|
"ofType": {
|
7781
|
-
"kind": "
|
7782
|
-
"name":
|
7783
|
-
"ofType":
|
8099
|
+
"kind": "NON_NULL",
|
8100
|
+
"name": null,
|
8101
|
+
"ofType": {
|
8102
|
+
"kind": "OBJECT",
|
8103
|
+
"name": "Ledger",
|
8104
|
+
"ofType": null
|
8105
|
+
}
|
7784
8106
|
}
|
7785
8107
|
}
|
7786
8108
|
},
|
@@ -8357,6 +8679,68 @@
|
|
8357
8679
|
"isDeprecated": false,
|
8358
8680
|
"deprecationReason": null
|
8359
8681
|
},
|
8682
|
+
{
|
8683
|
+
"name": "deleteLedger",
|
8684
|
+
"description": "Delete a Ledger",
|
8685
|
+
"args": [
|
8686
|
+
{
|
8687
|
+
"name": "ledger",
|
8688
|
+
"description": null,
|
8689
|
+
"type": {
|
8690
|
+
"kind": "NON_NULL",
|
8691
|
+
"name": null,
|
8692
|
+
"ofType": {
|
8693
|
+
"kind": "INPUT_OBJECT",
|
8694
|
+
"name": "LedgerMatchInput",
|
8695
|
+
"ofType": null
|
8696
|
+
}
|
8697
|
+
},
|
8698
|
+
"defaultValue": null
|
8699
|
+
}
|
8700
|
+
],
|
8701
|
+
"type": {
|
8702
|
+
"kind": "NON_NULL",
|
8703
|
+
"name": null,
|
8704
|
+
"ofType": {
|
8705
|
+
"kind": "UNION",
|
8706
|
+
"name": "DeleteLedgerResponse",
|
8707
|
+
"ofType": null
|
8708
|
+
}
|
8709
|
+
},
|
8710
|
+
"isDeprecated": false,
|
8711
|
+
"deprecationReason": null
|
8712
|
+
},
|
8713
|
+
{
|
8714
|
+
"name": "deleteSchema",
|
8715
|
+
"description": "Delete a Schema",
|
8716
|
+
"args": [
|
8717
|
+
{
|
8718
|
+
"name": "schema",
|
8719
|
+
"description": null,
|
8720
|
+
"type": {
|
8721
|
+
"kind": "NON_NULL",
|
8722
|
+
"name": null,
|
8723
|
+
"ofType": {
|
8724
|
+
"kind": "INPUT_OBJECT",
|
8725
|
+
"name": "SchemaMatchInput",
|
8726
|
+
"ofType": null
|
8727
|
+
}
|
8728
|
+
},
|
8729
|
+
"defaultValue": null
|
8730
|
+
}
|
8731
|
+
],
|
8732
|
+
"type": {
|
8733
|
+
"kind": "NON_NULL",
|
8734
|
+
"name": null,
|
8735
|
+
"ofType": {
|
8736
|
+
"kind": "UNION",
|
8737
|
+
"name": "DeleteSchemaResponse",
|
8738
|
+
"ofType": null
|
8739
|
+
}
|
8740
|
+
},
|
8741
|
+
"isDeprecated": false,
|
8742
|
+
"deprecationReason": null
|
8743
|
+
},
|
8360
8744
|
{
|
8361
8745
|
"name": "reconcileTx",
|
8362
8746
|
"description": "This mutation is used to [reconcile](https://fragment.dev/docs#reconcile-transactions) transactions from an external system into a Ledger Entry. This mutation does not require an idempotency key since a transaction can only be reconciled once per Linked Ledger Account. If you are reconciling a transfer between two Link Accounts which are both linked to the same Ledger, use a transit account in between to split the transfer into two `reconcileTx` calls.",
|
@@ -8826,6 +9210,16 @@
|
|
8826
9210
|
"enumValues": null,
|
8827
9211
|
"possibleTypes": null
|
8828
9212
|
},
|
9213
|
+
{
|
9214
|
+
"kind": "SCALAR",
|
9215
|
+
"name": "Parameters",
|
9216
|
+
"description": "A mapping of parameter keys to values.",
|
9217
|
+
"fields": null,
|
9218
|
+
"inputFields": null,
|
9219
|
+
"interfaces": null,
|
9220
|
+
"enumValues": null,
|
9221
|
+
"possibleTypes": null
|
9222
|
+
},
|
8829
9223
|
{
|
8830
9224
|
"kind": "SCALAR",
|
8831
9225
|
"name": "Period",
|
@@ -9130,9 +9524,13 @@
|
|
9130
9524
|
}
|
9131
9525
|
],
|
9132
9526
|
"type": {
|
9133
|
-
"kind": "
|
9134
|
-
"name":
|
9135
|
-
"ofType":
|
9527
|
+
"kind": "NON_NULL",
|
9528
|
+
"name": null,
|
9529
|
+
"ofType": {
|
9530
|
+
"kind": "OBJECT",
|
9531
|
+
"name": "LedgersConnection",
|
9532
|
+
"ofType": null
|
9533
|
+
}
|
9136
9534
|
},
|
9137
9535
|
"isDeprecated": false,
|
9138
9536
|
"deprecationReason": null
|
@@ -9255,9 +9653,13 @@
|
|
9255
9653
|
}
|
9256
9654
|
],
|
9257
9655
|
"type": {
|
9258
|
-
"kind": "
|
9259
|
-
"name":
|
9260
|
-
"ofType":
|
9656
|
+
"kind": "NON_NULL",
|
9657
|
+
"name": null,
|
9658
|
+
"ofType": {
|
9659
|
+
"kind": "OBJECT",
|
9660
|
+
"name": "SchemaConnection",
|
9661
|
+
"ofType": null
|
9662
|
+
}
|
9261
9663
|
},
|
9262
9664
|
"isDeprecated": false,
|
9263
9665
|
"deprecationReason": null
|
@@ -9318,14 +9720,14 @@
|
|
9318
9720
|
{
|
9319
9721
|
"kind": "ENUM",
|
9320
9722
|
"name": "ReadBalanceConsistencyMode",
|
9321
|
-
"description": "The consistency configuration of a Ledger Account's balance queries
|
9723
|
+
"description": "The consistency configuration of a Ledger Account's balance queries. If not provided as an argument to a balance query, the default behavior is to read eventually consistent balances. See [Configure consistency](https://fragment.dev/docs#configure-consistency).",
|
9322
9724
|
"fields": null,
|
9323
9725
|
"inputFields": null,
|
9324
9726
|
"interfaces": null,
|
9325
9727
|
"enumValues": [
|
9326
9728
|
{
|
9327
9729
|
"name": "eventual",
|
9328
|
-
"description": "Balance queries will read eventually consistent balances. This is the default behavior if `ReadBalanceConsistencyMode` is not provided as an argument to the balance field
|
9730
|
+
"description": "Balance queries will read eventually consistent balances. This is the default behavior if `ReadBalanceConsistencyMode` is not provided as an argument to the balance field. Both Ledger Accounts configured with strongly and eventually consistent balance updates support this enum.",
|
9329
9731
|
"isDeprecated": false,
|
9330
9732
|
"deprecationReason": null
|
9331
9733
|
},
|
@@ -9662,9 +10064,13 @@
|
|
9662
10064
|
}
|
9663
10065
|
],
|
9664
10066
|
"type": {
|
9665
|
-
"kind": "
|
9666
|
-
"name":
|
9667
|
-
"ofType":
|
10067
|
+
"kind": "NON_NULL",
|
10068
|
+
"name": null,
|
10069
|
+
"ofType": {
|
10070
|
+
"kind": "OBJECT",
|
10071
|
+
"name": "LedgersConnection",
|
10072
|
+
"ofType": null
|
10073
|
+
}
|
9668
10074
|
},
|
9669
10075
|
"isDeprecated": false,
|
9670
10076
|
"deprecationReason": null
|
@@ -10481,6 +10887,16 @@
|
|
10481
10887
|
}
|
10482
10888
|
},
|
10483
10889
|
"defaultValue": null
|
10890
|
+
},
|
10891
|
+
{
|
10892
|
+
"name": "version",
|
10893
|
+
"description": "Experimental: This field is not yet supported.",
|
10894
|
+
"type": {
|
10895
|
+
"kind": "SCALAR",
|
10896
|
+
"name": "Int",
|
10897
|
+
"ofType": null
|
10898
|
+
},
|
10899
|
+
"defaultValue": null
|
10484
10900
|
}
|
10485
10901
|
],
|
10486
10902
|
"interfaces": null,
|
@@ -10627,7 +11043,7 @@
|
|
10627
11043
|
},
|
10628
11044
|
{
|
10629
11045
|
"name": "version",
|
10630
|
-
"description": "Optional parameter to specify version of requested Schema. If not provided, it defaults to 0
|
11046
|
+
"description": "Optional parameter to specify version of requested Schema. If not provided, it defaults to 0, representing the latest available version for the provided Schema key.",
|
10631
11047
|
"type": {
|
10632
11048
|
"kind": "SCALAR",
|
10633
11049
|
"name": "Int",
|
@@ -10719,9 +11135,13 @@
|
|
10719
11135
|
|
10720
11136
|
],
|
10721
11137
|
"type": {
|
10722
|
-
"kind": "
|
10723
|
-
"name":
|
10724
|
-
"ofType":
|
11138
|
+
"kind": "NON_NULL",
|
11139
|
+
"name": null,
|
11140
|
+
"ofType": {
|
11141
|
+
"kind": "OBJECT",
|
11142
|
+
"name": "LedgerMigrationConnection",
|
11143
|
+
"ofType": null
|
11144
|
+
}
|
10725
11145
|
},
|
10726
11146
|
"isDeprecated": false,
|
10727
11147
|
"deprecationReason": null
|
@@ -10921,6 +11341,16 @@
|
|
10921
11341
|
"description": null,
|
10922
11342
|
"fields": null,
|
10923
11343
|
"inputFields": [
|
11344
|
+
{
|
11345
|
+
"name": "contains",
|
11346
|
+
"description": "Must contain the provided pattern somewhere within the string. For example, 'contains: hat' will match 'hat', 'chat', and 'hate'.",
|
11347
|
+
"type": {
|
11348
|
+
"kind": "SCALAR",
|
11349
|
+
"name": "String",
|
11350
|
+
"ofType": null
|
11351
|
+
},
|
11352
|
+
"defaultValue": null
|
11353
|
+
},
|
10924
11354
|
{
|
10925
11355
|
"name": "equalTo",
|
10926
11356
|
"description": "Must exactly equal the provided value",
|
@@ -11490,9 +11920,13 @@
|
|
11490
11920
|
|
11491
11921
|
],
|
11492
11922
|
"type": {
|
11493
|
-
"kind": "
|
11494
|
-
"name":
|
11495
|
-
"ofType":
|
11923
|
+
"kind": "NON_NULL",
|
11924
|
+
"name": null,
|
11925
|
+
"ofType": {
|
11926
|
+
"kind": "OBJECT",
|
11927
|
+
"name": "LedgerEntriesConnection",
|
11928
|
+
"ofType": null
|
11929
|
+
}
|
11496
11930
|
},
|
11497
11931
|
"isDeprecated": false,
|
11498
11932
|
"deprecationReason": null
|
@@ -11548,9 +11982,13 @@
|
|
11548
11982
|
|
11549
11983
|
],
|
11550
11984
|
"type": {
|
11551
|
-
"kind": "
|
11552
|
-
"name":
|
11553
|
-
"ofType":
|
11985
|
+
"kind": "NON_NULL",
|
11986
|
+
"name": null,
|
11987
|
+
"ofType": {
|
11988
|
+
"kind": "OBJECT",
|
11989
|
+
"name": "LedgerLinesConnection",
|
11990
|
+
"ofType": null
|
11991
|
+
}
|
11554
11992
|
},
|
11555
11993
|
"isDeprecated": false,
|
11556
11994
|
"deprecationReason": null
|
@@ -11770,15 +12208,19 @@
|
|
11770
12208
|
|
11771
12209
|
],
|
11772
12210
|
"type": {
|
11773
|
-
"kind": "
|
12211
|
+
"kind": "NON_NULL",
|
11774
12212
|
"name": null,
|
11775
12213
|
"ofType": {
|
11776
|
-
"kind": "
|
12214
|
+
"kind": "LIST",
|
11777
12215
|
"name": null,
|
11778
12216
|
"ofType": {
|
11779
|
-
"kind": "
|
11780
|
-
"name":
|
11781
|
-
"ofType":
|
12217
|
+
"kind": "NON_NULL",
|
12218
|
+
"name": null,
|
12219
|
+
"ofType": {
|
12220
|
+
"kind": "OBJECT",
|
12221
|
+
"name": "Tx",
|
12222
|
+
"ofType": null
|
12223
|
+
}
|
11782
12224
|
}
|
11783
12225
|
}
|
11784
12226
|
},
|
data/lib/fragment_client.rb
CHANGED
@@ -9,33 +9,23 @@ require 'uri'
|
|
9
9
|
require 'net/http'
|
10
10
|
require 'fragment_client/version'
|
11
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
|
29
|
-
end
|
30
|
-
|
31
|
-
class Client
|
32
|
-
# A monkey patch to change the definition name
|
33
|
-
class Definition
|
34
|
-
alias old_definition_name definition_name
|
35
|
-
def definition_name
|
36
|
-
old_definition_name.gsub(/#<Module.*>/, 'FragmentGraphQl__Dynamic')
|
37
|
-
end
|
38
|
-
end
|
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
|
39
29
|
end
|
40
30
|
end
|
41
31
|
|
@@ -57,7 +47,22 @@ module FragmentGraphQl
|
|
57
47
|
|
58
48
|
FragmentSchema = T.let(GraphQL::Client.load_schema("#{__dir__}/fragment.schema.json"), T.untyped)
|
59
49
|
|
60
|
-
|
50
|
+
# Create a custom client class for Fragment-specific behavior
|
51
|
+
class CustomClient < GraphQL::Client
|
52
|
+
class Definition < GraphQL::Client::Definition
|
53
|
+
def definition_name
|
54
|
+
super.gsub(/#<Module.*>/, 'FragmentGraphQl__Dynamic')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Add this method to allow creating new instances
|
59
|
+
def self.new(schema:, execute:)
|
60
|
+
super(schema: schema, execute: execute)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Use our custom client instead of the base GraphQL::Client
|
65
|
+
Client = T.let(CustomClient.new(schema: FragmentSchema, execute: HTTP), CustomClient)
|
61
66
|
|
62
67
|
FragmentQueries = T.let(Client.parse(
|
63
68
|
File.read("#{__dir__}/queries.graphql")
|
@@ -89,7 +94,13 @@ class FragmentClient
|
|
89
94
|
execute = api_url ? FragmentGraphQl::CustomHTTP.new(URI.parse(api_url).to_s) : FragmentGraphQl::HTTP
|
90
95
|
@execute = T.let(execute, GraphQL::Client::HTTP)
|
91
96
|
|
92
|
-
@client = T.let(
|
97
|
+
@client = T.let(
|
98
|
+
FragmentGraphQl::CustomClient.new(
|
99
|
+
schema: FragmentGraphQl::FragmentSchema,
|
100
|
+
execute: @execute
|
101
|
+
),
|
102
|
+
FragmentGraphQl::CustomClient
|
103
|
+
)
|
93
104
|
@token = T.let(create_token, Token)
|
94
105
|
|
95
106
|
define_method_from_queries(FragmentGraphQl::FragmentQueries)
|
@@ -103,10 +114,15 @@ class FragmentClient
|
|
103
114
|
end
|
104
115
|
end
|
105
116
|
|
117
|
+
# Move these error class definitions up, before the query method
|
118
|
+
class ResponseError < GraphQL::Client::Error; end
|
119
|
+
class NetworkError < GraphQL::Client::Error; end
|
120
|
+
class AuthenticationError < StandardError; end
|
121
|
+
class TokenExpiredError < StandardError; end
|
122
|
+
|
106
123
|
sig { params(query: T.untyped, variables: T.untyped).returns(T.untyped) }
|
107
124
|
def query(query, variables)
|
108
|
-
|
109
|
-
@token = create_token if Time.now > @token.expires_at - expiry_time_skew
|
125
|
+
refresh_token_if_needed
|
110
126
|
@client.query(query, variables: variables, context: { access_token: @token.token })
|
111
127
|
end
|
112
128
|
|
@@ -138,17 +154,65 @@ class FragmentClient
|
|
138
154
|
|
139
155
|
case response
|
140
156
|
when Net::HTTPSuccess
|
141
|
-
# Parse the response body
|
142
157
|
body = JSON.parse(response.body)
|
143
158
|
Token.new(
|
144
159
|
token: T.let(body['access_token'], String),
|
145
160
|
expires_at: Time.now + T.let(body['expires_in'], Integer)
|
146
161
|
)
|
162
|
+
when Net::HTTPUnauthorized
|
163
|
+
raise AuthenticationError, "Invalid credentials: #{response.body}"
|
147
164
|
else
|
148
|
-
raise
|
165
|
+
raise AuthenticationError, "Authentication failed (#{response.code}): #{response.body}"
|
149
166
|
end
|
167
|
+
rescue JSON::ParserError => e
|
168
|
+
raise AuthenticationError, "Invalid response format: #{e.message}"
|
150
169
|
rescue StandardError => e
|
151
|
-
raise
|
170
|
+
raise AuthenticationError, "Authentication failed: #{e.message}"
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
class Configuration
|
175
|
+
extend T::Sig
|
176
|
+
|
177
|
+
sig { returns(Integer) }
|
178
|
+
attr_accessor :token_expiry_buffer
|
179
|
+
sig { returns(Logger) }
|
180
|
+
attr_accessor :logger
|
181
|
+
|
182
|
+
sig { void }
|
183
|
+
def initialize
|
184
|
+
@token_expiry_buffer = T.let(120, Integer)
|
185
|
+
@logger = T.let(Logger.new($stdout), Logger)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
class << self
|
190
|
+
extend T::Sig
|
191
|
+
|
192
|
+
sig { returns(Configuration) }
|
193
|
+
def configuration
|
194
|
+
@configuration ||= Configuration.new
|
152
195
|
end
|
196
|
+
|
197
|
+
sig { params(blk: T.proc.params(config: Configuration).void).void }
|
198
|
+
def configure(&blk)
|
199
|
+
yield(configuration)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
sig { returns(Logger) }
|
204
|
+
def logger
|
205
|
+
self.class.configuration.logger
|
206
|
+
end
|
207
|
+
|
208
|
+
sig { void }
|
209
|
+
def refresh_token_if_needed
|
210
|
+
return unless token_expired?
|
211
|
+
@token = create_token
|
212
|
+
end
|
213
|
+
|
214
|
+
sig { returns(T::Boolean) }
|
215
|
+
def token_expired?
|
216
|
+
Time.now > @token.expires_at - self.class.configuration.token_expiry_buffer
|
153
217
|
end
|
154
218
|
end
|
data/lib/queries.graphql
CHANGED
@@ -543,6 +543,52 @@ query GetLedgerAccountBalance(
|
|
543
543
|
}
|
544
544
|
}
|
545
545
|
|
546
|
+
query ListLedgerEntryGroupBalances(
|
547
|
+
$ledgerIk: SafeString!
|
548
|
+
$groupKey: SafeString!
|
549
|
+
$groupValue: SafeString!
|
550
|
+
$consistencyMode: ReadBalanceConsistencyMode = use_account
|
551
|
+
$after: String
|
552
|
+
$before: String
|
553
|
+
$first: Int
|
554
|
+
$last: Int
|
555
|
+
$filter: LedgerEntryGroupBalanceFilterSet
|
556
|
+
) {
|
557
|
+
ledgerEntryGroup(ledgerEntryGroup: {
|
558
|
+
ledger: { ik: $ledgerIk },
|
559
|
+
key: $groupKey,
|
560
|
+
value: $groupValue,
|
561
|
+
}) {
|
562
|
+
key
|
563
|
+
value
|
564
|
+
created
|
565
|
+
balances(
|
566
|
+
after: $after,
|
567
|
+
before: $before,
|
568
|
+
first: $first,
|
569
|
+
last: $last,
|
570
|
+
filter: $filter,
|
571
|
+
){
|
572
|
+
nodes {
|
573
|
+
account {
|
574
|
+
path
|
575
|
+
}
|
576
|
+
currency {
|
577
|
+
code
|
578
|
+
customCurrencyId
|
579
|
+
}
|
580
|
+
ownBalance(consistencyMode: $consistencyMode)
|
581
|
+
}
|
582
|
+
pageInfo {
|
583
|
+
hasNextPage
|
584
|
+
endCursor
|
585
|
+
hasPreviousPage
|
586
|
+
startCursor
|
587
|
+
}
|
588
|
+
}
|
589
|
+
}
|
590
|
+
}
|
591
|
+
|
546
592
|
query GetSchema($key: SafeString!, $version: Int) {
|
547
593
|
schema(schema: { key: $key, version: $version }) {
|
548
594
|
key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fragment-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fragment
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|