forked from facebook/relay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RESULT errors to snapshot and catch values boolean ok!
Reviewed By: tyao1 Differential Revision: D55992996 fbshipit-source-id: d73cfb27ae8b6d9c9aa42760482aa4e7cd5fc9d1
- Loading branch information
1 parent
696a1b3
commit 2a2a9a9
Showing
5 changed files
with
299 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...es/relay-runtime/store/__tests__/__mocks__/RelayReaderCatchFieldsTest3Fragment.graphql.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @oncall relay | ||
* @flow | ||
* @lightSyntaxTransform | ||
* @nogrep | ||
*/ | ||
|
||
/* eslint-disable */ | ||
|
||
'use strict'; | ||
|
||
/*:: | ||
import type { Fragment, ReaderFragment } from 'relay-runtime'; | ||
import type { FragmentType } from "relay-runtime"; | ||
declare export opaque type RelayReaderCatchFieldsTest3Fragment$fragmentType: FragmentType; | ||
export type RelayReaderCatchFieldsTest3Fragment$data = {| | ||
+profilePicture: ?{| | ||
+uri: ?string, | ||
|}, | ||
+$fragmentType: RelayReaderCatchFieldsTest3Fragment$fragmentType, | ||
|}; | ||
export type RelayReaderCatchFieldsTest3Fragment$key = { | ||
+$data?: RelayReaderCatchFieldsTest3Fragment$data, | ||
+$fragmentSpreads: RelayReaderCatchFieldsTest3Fragment$fragmentType, | ||
... | ||
}; | ||
*/ | ||
|
||
var node/*: ReaderFragment*/ = { | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "RelayReaderCatchFieldsTest3Fragment", | ||
"selections": [ | ||
{ | ||
"alias": "profilePicture", | ||
"args": null, | ||
"concreteType": "Image", | ||
"kind": "LinkedField", | ||
"name": "__profilePicture_test", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "uri", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "User", | ||
"abstractKey": null | ||
}; | ||
|
||
if (__DEV__) { | ||
(node/*: any*/).hash = "9a91f81e017f3267c21ec7f465854acf"; | ||
} | ||
|
||
module.exports = ((node/*: any*/)/*: Fragment< | ||
RelayReaderCatchFieldsTest3Fragment$fragmentType, | ||
RelayReaderCatchFieldsTest3Fragment$data, | ||
>*/); |
134 changes: 134 additions & 0 deletions
134
packages/relay-runtime/store/__tests__/__mocks__/RelayReaderCatchFieldsTest3Query.graphql.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @oncall relay | ||
* @flow | ||
* @lightSyntaxTransform | ||
* @nogrep | ||
*/ | ||
|
||
/* eslint-disable */ | ||
|
||
'use strict'; | ||
|
||
/*:: | ||
import type { ConcreteRequest, Query } from 'relay-runtime'; | ||
export type RelayReaderCatchFieldsTest3Query$variables = {||}; | ||
export type RelayReaderCatchFieldsTest3Query$data = {| | ||
+me: ?{| | ||
+profilePicture: ?{| | ||
+uri: ?string, | ||
|}, | ||
|}, | ||
|}; | ||
export type RelayReaderCatchFieldsTest3Query = {| | ||
response: RelayReaderCatchFieldsTest3Query$data, | ||
variables: RelayReaderCatchFieldsTest3Query$variables, | ||
|}; | ||
*/ | ||
|
||
var node/*: ConcreteRequest*/ = (function(){ | ||
var v0 = [ | ||
{ | ||
"kind": "Literal", | ||
"name": "size", | ||
"value": 32 | ||
} | ||
]; | ||
return { | ||
"fragment": { | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "RelayReaderCatchFieldsTest3Query", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": (v0/*: any*/), | ||
"concreteType": "Image", | ||
"kind": "LinkedField", | ||
"name": "profilePicture", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"args": null, | ||
"kind": "FragmentSpread", | ||
"name": "RelayReaderCatchFieldsTest3Fragment" | ||
} | ||
], | ||
"storageKey": "profilePicture(size:32)" | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Query", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [], | ||
"kind": "Operation", | ||
"name": "RelayReaderCatchFieldsTest3Query", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": (v0/*: any*/), | ||
"concreteType": "Image", | ||
"kind": "LinkedField", | ||
"name": "profilePicture", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "uri", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": "profilePicture(size:32)" | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
"params": { | ||
"cacheID": "25d9b9bf8df79f73e41a4671ce1d207d", | ||
"id": null, | ||
"metadata": {}, | ||
"name": "RelayReaderCatchFieldsTest3Query", | ||
"operationKind": "query", | ||
"text": "query RelayReaderCatchFieldsTest3Query {\n me {\n profilePicture(size: 32) {\n uri\n }\n id\n }\n}\n" | ||
} | ||
}; | ||
})(); | ||
|
||
if (__DEV__) { | ||
(node/*: any*/).hash = "7cd54b0080d8dab528631b15888562dc"; | ||
} | ||
|
||
module.exports = ((node/*: any*/)/*: Query< | ||
RelayReaderCatchFieldsTest3Query$variables, | ||
RelayReaderCatchFieldsTest3Query$data, | ||
>*/); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters