From 8d4900661d17a7b442176a9ba3f02ad4f7dbfafa Mon Sep 17 00:00:00 2001 From: Andrey Lunyov Date: Wed, 10 Aug 2022 11:26:18 -0700 Subject: [PATCH] Add `assignClientAbstractTypes` to the DataChecker Reviewed By: rbalicki2 Differential Revision: D38578043 fbshipit-source-id: 1758e08e93f71f4b24485dc8cb445034fd685af7 --- ...ightUseQueryFromServerTestQuery.graphql.js | 138 +++++++++++++++ ...ightUseFragmentTestUserFragment.graphql.js | 57 +++++++ ...lightUseFragmentTestViewerQuery.graphql.js | 147 ++++++++++++++++ ...RendererTaskTestActorName1Query.graphql.js | 138 +++++++++++++++ ...tRendererTaskTestActorNameQuery.graphql.js | 138 +++++++++++++++ ...askTestActorProfilePictureQuery.graphql.js | 158 ++++++++++++++++++ ...yFlightRendererTaskTestFragment.graphql.js | 57 +++++++ ...elayFlightRendererTaskTestQuery.graphql.js | 141 ++++++++++++++++ ...LoadQueryForClientTestNodeQuery.graphql.js | 137 +++++++++++++++ ...ayFlightUseQueryTestViewerQuery.graphql.js | 138 +++++++++++++++ ...yFlightTestClientComponentQuery.graphql.js | 137 +++++++++++++++ packages/relay-runtime/store/DataChecker.js | 23 +++ .../store/__tests__/DataChecker-test.js | 42 +++++ ...ayModernEnvironment-TypeRefinement-test.js | 29 ++++ ...aCheckerTestClientAbstractQuery.graphql.js | 125 ++++++++++++++ .../DataCheckerTestClientInterface.graphql.js | 62 +++++++ 16 files changed, 1667 insertions(+) create mode 100644 packages/relay-flight-experimental/client/__tests__/__generated__/RelayFlightUseQueryFromServerTestQuery.graphql.js create mode 100644 packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestUserFragment.graphql.js create mode 100644 packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestViewerQuery.graphql.js create mode 100644 packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorName1Query.graphql.js create mode 100644 packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorNameQuery.graphql.js create mode 100644 packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorProfilePictureQuery.graphql.js create mode 100644 packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestFragment.graphql.js create mode 100644 packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestQuery.graphql.js create mode 100644 packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightLoadQueryForClientTestNodeQuery.graphql.js create mode 100644 packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightUseQueryTestViewerQuery.graphql.js create mode 100644 packages/relay-flight-experimental/test-utils/__generated__/RelayFlightTestClientComponentQuery.graphql.js create mode 100644 packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientAbstractQuery.graphql.js create mode 100644 packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientInterface.graphql.js diff --git a/packages/relay-flight-experimental/client/__tests__/__generated__/RelayFlightUseQueryFromServerTestQuery.graphql.js b/packages/relay-flight-experimental/client/__tests__/__generated__/RelayFlightUseQueryFromServerTestQuery.graphql.js new file mode 100644 index 0000000000000..53eeb498fa1e5 --- /dev/null +++ b/packages/relay-flight-experimental/client/__tests__/__generated__/RelayFlightUseQueryFromServerTestQuery.graphql.js @@ -0,0 +1,138 @@ +/** + * 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. + * + * @generated SignedSource<<0e299448032f1e6dbc8aac333fe69989>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightUseQueryFromServerTestQuery$variables = {||}; +export type RelayFlightUseQueryFromServerTestQuery$data = {| + +viewer: ?{| + +actor: ?{| + +name: ?string, + |}, + |}, +|}; +export type RelayFlightUseQueryFromServerTestQuery = {| + response: RelayFlightUseQueryFromServerTestQuery$data, + variables: RelayFlightUseQueryFromServerTestQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightUseQueryFromServerTestQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "RelayFlightUseQueryFromServerTestQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "04a20833e0f0cf884d494479810f7da7", + "id": null, + "metadata": {}, + "name": "RelayFlightUseQueryFromServerTestQuery", + "operationKind": "query", + "text": "query RelayFlightUseQueryFromServerTestQuery {\n viewer {\n actor {\n __typename\n name\n id\n }\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "416036869a169c2e1fa4989b7b1ff765"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightUseQueryFromServerTestQuery$variables, + RelayFlightUseQueryFromServerTestQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestUserFragment.graphql.js b/packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestUserFragment.graphql.js new file mode 100644 index 0000000000000..0b472d6e93c94 --- /dev/null +++ b/packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestUserFragment.graphql.js @@ -0,0 +1,57 @@ +/** + * 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. + * + * @generated SignedSource<<578161916fbf5cb34ac160277ea4e4f3>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +import type { FragmentType } from "relay-runtime"; +declare export opaque type RelayFlightUseFragmentTestUserFragment$fragmentType: FragmentType; +export type RelayFlightUseFragmentTestUserFragment$data = {| + +name: ?string, + +$fragmentType: RelayFlightUseFragmentTestUserFragment$fragmentType, +|}; +export type RelayFlightUseFragmentTestUserFragment$key = { + +$data?: RelayFlightUseFragmentTestUserFragment$data, + +$fragmentSpreads: RelayFlightUseFragmentTestUserFragment$fragmentType, + ... +}; +*/ + +var node/*: ReaderFragment*/ = { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightUseFragmentTestUserFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + } + ], + "type": "User", + "abstractKey": null +}; + +if (__DEV__) { + (node/*: any*/).hash = "19b3122103851e7411ed9ab586799c09"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + RelayFlightUseFragmentTestUserFragment$fragmentType, + RelayFlightUseFragmentTestUserFragment$data, +>*/); diff --git a/packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestViewerQuery.graphql.js b/packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestViewerQuery.graphql.js new file mode 100644 index 0000000000000..54a77641b0ab8 --- /dev/null +++ b/packages/relay-flight-experimental/hybrid/__tests__/__generated__/RelayFlightUseFragmentTestViewerQuery.graphql.js @@ -0,0 +1,147 @@ +/** + * 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. + * + * @generated SignedSource<<22feeb24a68ae2c337c86d887b1c14b6>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +import type { RelayFlightUseFragmentTestUserFragment$fragmentType } from "./RelayFlightUseFragmentTestUserFragment.graphql"; +export type RelayFlightUseFragmentTestViewerQuery$variables = {||}; +export type RelayFlightUseFragmentTestViewerQuery$data = {| + +viewer: ?{| + +actor: ?{| + +$fragmentSpreads: RelayFlightUseFragmentTestUserFragment$fragmentType, + |}, + |}, +|}; +export type RelayFlightUseFragmentTestViewerQuery = {| + response: RelayFlightUseFragmentTestViewerQuery$data, + variables: RelayFlightUseFragmentTestViewerQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightUseFragmentTestViewerQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "args": null, + "kind": "FragmentSpread", + "name": "RelayFlightUseFragmentTestUserFragment" + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "RelayFlightUseFragmentTestViewerQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + } + ], + "type": "User", + "abstractKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "ea9607a71e3f730009a26ccbc7c0ba55", + "id": null, + "metadata": {}, + "name": "RelayFlightUseFragmentTestViewerQuery", + "operationKind": "query", + "text": "query RelayFlightUseFragmentTestViewerQuery {\n viewer {\n actor {\n __typename\n ...RelayFlightUseFragmentTestUserFragment\n id\n }\n }\n}\n\nfragment RelayFlightUseFragmentTestUserFragment on User {\n name\n}\n" + } +}; + +if (__DEV__) { + (node/*: any*/).hash = "59bb8df9e6386b5ef6761a827c983e38"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightUseFragmentTestViewerQuery$variables, + RelayFlightUseFragmentTestViewerQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorName1Query.graphql.js b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorName1Query.graphql.js new file mode 100644 index 0000000000000..a9a4a524c2924 --- /dev/null +++ b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorName1Query.graphql.js @@ -0,0 +1,138 @@ +/** + * 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. + * + * @generated SignedSource<<0b230e3ad912c1a285d56d20cc5572f0>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightRendererTaskTestActorName1Query$variables = {||}; +export type RelayFlightRendererTaskTestActorName1Query$data = {| + +viewer: ?{| + +actor: ?{| + +name: ?string, + |}, + |}, +|}; +export type RelayFlightRendererTaskTestActorName1Query = {| + response: RelayFlightRendererTaskTestActorName1Query$data, + variables: RelayFlightRendererTaskTestActorName1Query$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightRendererTaskTestActorName1Query", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "RelayFlightRendererTaskTestActorName1Query", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "fbdf411656a37578cae3c727ccf0b084", + "id": null, + "metadata": {}, + "name": "RelayFlightRendererTaskTestActorName1Query", + "operationKind": "query", + "text": "query RelayFlightRendererTaskTestActorName1Query {\n viewer {\n actor {\n __typename\n name\n id\n }\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "1fa4e382973f5c9cfd4bcc3707ea26ac"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightRendererTaskTestActorName1Query$variables, + RelayFlightRendererTaskTestActorName1Query$data, +>*/); diff --git a/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorNameQuery.graphql.js b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorNameQuery.graphql.js new file mode 100644 index 0000000000000..11c0e96486579 --- /dev/null +++ b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorNameQuery.graphql.js @@ -0,0 +1,138 @@ +/** + * 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. + * + * @generated SignedSource<> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightRendererTaskTestActorNameQuery$variables = {||}; +export type RelayFlightRendererTaskTestActorNameQuery$data = {| + +viewer: ?{| + +actor: ?{| + +name: ?string, + |}, + |}, +|}; +export type RelayFlightRendererTaskTestActorNameQuery = {| + response: RelayFlightRendererTaskTestActorNameQuery$data, + variables: RelayFlightRendererTaskTestActorNameQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightRendererTaskTestActorNameQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "RelayFlightRendererTaskTestActorNameQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "61b77ee7877fafd97eab729ad055f6fc", + "id": null, + "metadata": {}, + "name": "RelayFlightRendererTaskTestActorNameQuery", + "operationKind": "query", + "text": "query RelayFlightRendererTaskTestActorNameQuery {\n viewer {\n actor {\n __typename\n name\n id\n }\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "9ce4514c0e9dee254032e193575d8006"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightRendererTaskTestActorNameQuery$variables, + RelayFlightRendererTaskTestActorNameQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorProfilePictureQuery.graphql.js b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorProfilePictureQuery.graphql.js new file mode 100644 index 0000000000000..92e789ac19ef5 --- /dev/null +++ b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestActorProfilePictureQuery.graphql.js @@ -0,0 +1,158 @@ +/** + * 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. + * + * @generated SignedSource<<1c0900d300856606a2c14657ee0901db>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightRendererTaskTestActorProfilePictureQuery$variables = {||}; +export type RelayFlightRendererTaskTestActorProfilePictureQuery$data = {| + +viewer: ?{| + +actor: ?{| + +profile_picture?: ?{| + +uri: ?string, + |}, + |}, + |}, +|}; +export type RelayFlightRendererTaskTestActorProfilePictureQuery = {| + response: RelayFlightRendererTaskTestActorProfilePictureQuery$data, + variables: RelayFlightRendererTaskTestActorProfilePictureQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Image", + "kind": "LinkedField", + "name": "profile_picture", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "uri", + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "User", + "abstractKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightRendererTaskTestActorProfilePictureQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "RelayFlightRendererTaskTestActorProfilePictureQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "9eb027111634573c34369fa76b4932ea", + "id": null, + "metadata": {}, + "name": "RelayFlightRendererTaskTestActorProfilePictureQuery", + "operationKind": "query", + "text": "query RelayFlightRendererTaskTestActorProfilePictureQuery {\n viewer {\n actor {\n __typename\n ... on User {\n profile_picture {\n uri\n }\n }\n id\n }\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "6b63ea648d695c93d1a1b95355c80fbd"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightRendererTaskTestActorProfilePictureQuery$variables, + RelayFlightRendererTaskTestActorProfilePictureQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestFragment.graphql.js b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestFragment.graphql.js new file mode 100644 index 0000000000000..a9ac66bb33428 --- /dev/null +++ b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestFragment.graphql.js @@ -0,0 +1,57 @@ +/** + * 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. + * + * @generated SignedSource<> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +import type { FragmentType } from "relay-runtime"; +declare export opaque type RelayFlightRendererTaskTestFragment$fragmentType: FragmentType; +export type RelayFlightRendererTaskTestFragment$data = {| + +name: ?string, + +$fragmentType: RelayFlightRendererTaskTestFragment$fragmentType, +|}; +export type RelayFlightRendererTaskTestFragment$key = { + +$data?: RelayFlightRendererTaskTestFragment$data, + +$fragmentSpreads: RelayFlightRendererTaskTestFragment$fragmentType, + ... +}; +*/ + +var node/*: ReaderFragment*/ = { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightRendererTaskTestFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + } + ], + "type": "User", + "abstractKey": null +}; + +if (__DEV__) { + (node/*: any*/).hash = "0a5b832310fa1b717e3bd79c8897504e"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + RelayFlightRendererTaskTestFragment$fragmentType, + RelayFlightRendererTaskTestFragment$data, +>*/); diff --git a/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestQuery.graphql.js b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestQuery.graphql.js new file mode 100644 index 0000000000000..9bbc774100e44 --- /dev/null +++ b/packages/relay-flight-experimental/runtime/__tests__/__generated__/RelayFlightRendererTaskTestQuery.graphql.js @@ -0,0 +1,141 @@ +/** + * 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. + * + * @generated SignedSource<<9889a9f66ad3f61460db8ddb31fc1272>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +import type { RelayFlightRendererTaskTestFragment$fragmentType } from "./RelayFlightRendererTaskTestFragment.graphql"; +export type RelayFlightRendererTaskTestQuery$variables = {| + id: string, +|}; +export type RelayFlightRendererTaskTestQuery$data = {| + +node: ?{| + +$fragmentSpreads: RelayFlightRendererTaskTestFragment$fragmentType, + |}, +|}; +export type RelayFlightRendererTaskTestQuery = {| + response: RelayFlightRendererTaskTestQuery$data, + variables: RelayFlightRendererTaskTestQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "id" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "id" + } +]; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightRendererTaskTestQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "args": null, + "kind": "FragmentSpread", + "name": "RelayFlightRendererTaskTestFragment" + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "RelayFlightRendererTaskTestQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + } + ], + "type": "User", + "abstractKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "cdd7f18850e2c613a80b987dcc1f2ef3", + "id": null, + "metadata": {}, + "name": "RelayFlightRendererTaskTestQuery", + "operationKind": "query", + "text": "query RelayFlightRendererTaskTestQuery(\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...RelayFlightRendererTaskTestFragment\n id\n }\n}\n\nfragment RelayFlightRendererTaskTestFragment on User {\n name\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "5d0acc589a993b333c9e5085f6804c21"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightRendererTaskTestQuery$variables, + RelayFlightRendererTaskTestQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightLoadQueryForClientTestNodeQuery.graphql.js b/packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightLoadQueryForClientTestNodeQuery.graphql.js new file mode 100644 index 0000000000000..1949d5159cc7c --- /dev/null +++ b/packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightLoadQueryForClientTestNodeQuery.graphql.js @@ -0,0 +1,137 @@ +/** + * 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. + * + * @generated SignedSource<<12f1d239b33b7d29c66d3536e3a86af3>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightLoadQueryForClientTestNodeQuery$variables = {| + id: string, +|}; +export type RelayFlightLoadQueryForClientTestNodeQuery$data = {| + +node: ?{| + +name?: ?string, + |}, +|}; +export type RelayFlightLoadQueryForClientTestNodeQuery = {| + response: RelayFlightLoadQueryForClientTestNodeQuery$data, + variables: RelayFlightLoadQueryForClientTestNodeQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "id" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "id" + } +], +v2 = { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + } + ], + "type": "User", + "abstractKey": null +}; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightLoadQueryForClientTestNodeQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v2/*: any*/) + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "RelayFlightLoadQueryForClientTestNodeQuery", + "selections": [ + { + "alias": null, + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "a13d68ead253f7e61d79b81a6dd09935", + "id": null, + "metadata": {}, + "name": "RelayFlightLoadQueryForClientTestNodeQuery", + "operationKind": "query", + "text": "query RelayFlightLoadQueryForClientTestNodeQuery(\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ... on User {\n name\n }\n id\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "b1b91e0caddc6277ac6837390dd47fa3"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightLoadQueryForClientTestNodeQuery$variables, + RelayFlightLoadQueryForClientTestNodeQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightUseQueryTestViewerQuery.graphql.js b/packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightUseQueryTestViewerQuery.graphql.js new file mode 100644 index 0000000000000..80ce06698db93 --- /dev/null +++ b/packages/relay-flight-experimental/server/__tests__/__generated__/RelayFlightUseQueryTestViewerQuery.graphql.js @@ -0,0 +1,138 @@ +/** + * 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. + * + * @generated SignedSource<<14568df4e95c7538dfa2f4c123d51814>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightUseQueryTestViewerQuery$variables = {||}; +export type RelayFlightUseQueryTestViewerQuery$data = {| + +viewer: ?{| + +actor: ?{| + +name: ?string, + |}, + |}, +|}; +export type RelayFlightUseQueryTestViewerQuery = {| + response: RelayFlightUseQueryTestViewerQuery$data, + variables: RelayFlightUseQueryTestViewerQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightUseQueryTestViewerQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "RelayFlightUseQueryTestViewerQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "Viewer", + "kind": "LinkedField", + "name": "viewer", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "actor", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "fd8264bd7529fec252f61e9cdb5d0fbd", + "id": null, + "metadata": {}, + "name": "RelayFlightUseQueryTestViewerQuery", + "operationKind": "query", + "text": "query RelayFlightUseQueryTestViewerQuery {\n viewer {\n actor {\n __typename\n name\n id\n }\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "47c90be3921dd8a1453eabbc8a28ba4e"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightUseQueryTestViewerQuery$variables, + RelayFlightUseQueryTestViewerQuery$data, +>*/); diff --git a/packages/relay-flight-experimental/test-utils/__generated__/RelayFlightTestClientComponentQuery.graphql.js b/packages/relay-flight-experimental/test-utils/__generated__/RelayFlightTestClientComponentQuery.graphql.js new file mode 100644 index 0000000000000..7b1a6f49be0ec --- /dev/null +++ b/packages/relay-flight-experimental/test-utils/__generated__/RelayFlightTestClientComponentQuery.graphql.js @@ -0,0 +1,137 @@ +/** + * 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. + * + * @generated SignedSource<<45614a551293de934384dbd3dfdec215>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type RelayFlightTestClientComponentQuery$variables = {| + id: string, +|}; +export type RelayFlightTestClientComponentQuery$data = {| + +user: ?{| + +name?: ?string, + |}, +|}; +export type RelayFlightTestClientComponentQuery = {| + response: RelayFlightTestClientComponentQuery$data, + variables: RelayFlightTestClientComponentQuery$variables, +|}; +*/ + +var node/*: ConcreteRequest*/ = (function(){ +var v0 = [ + { + "defaultValue": null, + "kind": "LocalArgument", + "name": "id" + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "id" + } +], +v2 = { + "kind": "InlineFragment", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null + } + ], + "type": "User", + "abstractKey": null +}; +return { + "fragment": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Fragment", + "metadata": null, + "name": "RelayFlightTestClientComponentQuery", + "selections": [ + { + "alias": "user", + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + (v2/*: any*/) + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": (v0/*: any*/), + "kind": "Operation", + "name": "RelayFlightTestClientComponentQuery", + "selections": [ + { + "alias": "user", + "args": (v1/*: any*/), + "concreteType": null, + "kind": "LinkedField", + "name": "node", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + (v2/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "4110cdff5a413c2bcbcbb9961e59e948", + "id": null, + "metadata": {}, + "name": "RelayFlightTestClientComponentQuery", + "operationKind": "query", + "text": "query RelayFlightTestClientComponentQuery(\n $id: ID!\n) {\n user: node(id: $id) {\n __typename\n ... on User {\n name\n }\n id\n }\n}\n" + } +}; +})(); + +if (__DEV__) { + (node/*: any*/).hash = "b5a32b8527dbf17abf09bbca0375003c"; +} + +module.exports = ((node/*: any*/)/*: Query< + RelayFlightTestClientComponentQuery$variables, + RelayFlightTestClientComponentQuery$data, +>*/); diff --git a/packages/relay-runtime/store/DataChecker.js b/packages/relay-runtime/store/DataChecker.js index d75697c99f777..61d5de1430e0a 100644 --- a/packages/relay-runtime/store/DataChecker.js +++ b/packages/relay-runtime/store/DataChecker.js @@ -33,6 +33,8 @@ import type { RecordSource, } from './RelayStoreTypes'; +import {TYPE_SCHEMA_TYPE} from './TypeID'; + const RelayRecordSourceMutator = require('../mutations/RelayRecordSourceMutator'); const RelayRecordSourceProxy = require('../mutations/RelayRecordSourceProxy'); const getOperation = require('../util/getOperation'); @@ -184,6 +186,7 @@ class DataChecker { } check(node: NormalizationNode, dataID: DataID): Availability { + this._assignClientAbstractTypes(node); this._traverse(node, dataID); return this._recordWasMissing === true @@ -592,6 +595,7 @@ class DataChecker { this._source = this._getSourceForActor(actorIdentifier); this._mutator = mutator; this._recordSourceProxy = recordSourceProxy; + this._assignClientAbstractTypes(field); this._traverse(field, linkedID); this._source = prevSource; this._mutator = prevMutator; @@ -649,6 +653,25 @@ class DataChecker { } this._variables = prevVariables; } + + // For abstract types defined in the client schema extension, we won't be + // getting `__is` hints from the server. To handle this, the + // compiler attaches additional metadata on the normalization artifact, + // which we need to record into the store. + _assignClientAbstractTypes(node: NormalizationNode) { + const {clientAbstractTypes} = node; + if (clientAbstractTypes != null) { + for (const abstractType of Object.keys(clientAbstractTypes)) { + for (const concreteType of clientAbstractTypes[abstractType]) { + const typeID = generateTypeID(concreteType); + if (this._source.get(typeID) == null) { + this._mutator.create(typeID, TYPE_SCHEMA_TYPE); + } + this._mutator.setValue(typeID, abstractType, true); + } + } + } + } } module.exports = { diff --git a/packages/relay-runtime/store/__tests__/DataChecker-test.js b/packages/relay-runtime/store/__tests__/DataChecker-test.js index 56c8ec4c16501..20ac14de63581 100644 --- a/packages/relay-runtime/store/__tests__/DataChecker-test.js +++ b/packages/relay-runtime/store/__tests__/DataChecker-test.js @@ -3271,4 +3271,46 @@ describe('check()', () => { expect(target.size()).toBe(0); }); }); + + it('should assign client-only abstract type information to the target source', () => { + graphql` + fragment DataCheckerTestClientInterface on ClientInterface { + description + } + `; + const clientQuery = graphql` + query DataCheckerTestClientAbstractQuery { + client_interface { + ...DataCheckerTestClientInterface + } + } + `; + const source = RelayRecordSource.create(); + const target = RelayRecordSource.create(); + const status = check( + () => source, + () => target, + INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE, + createNormalizationSelector( + getRequest(clientQuery).operation, + 'client:root', + {}, + ), + [], + null, + defaultGetDataID, + ); + expect(target.toJSON()).toEqual({ + 'client:__type:ClientTypeImplementingClientInterface': { + __id: 'client:__type:ClientTypeImplementingClientInterface', + __typename: '__TypeSchema', + __isClientInterface: true, + }, + 'client:__type:OtherClientTypeImplementingClientInterface': { + __id: 'client:__type:OtherClientTypeImplementingClientInterface', + __typename: '__TypeSchema', + __isClientInterface: true, + }, + }); + }); }); diff --git a/packages/relay-runtime/store/__tests__/RelayModernEnvironment-TypeRefinement-test.js b/packages/relay-runtime/store/__tests__/RelayModernEnvironment-TypeRefinement-test.js index da3bcf586a616..7302b6a4637bb 100644 --- a/packages/relay-runtime/store/__tests__/RelayModernEnvironment-TypeRefinement-test.js +++ b/packages/relay-runtime/store/__tests__/RelayModernEnvironment-TypeRefinement-test.js @@ -1885,5 +1885,34 @@ describe('missing data detection', () => { }); expect(fragmentSnapshot.isMissingData).toBe(false); }); + + it('knows when concrete types match abstract types by metadata attached to normalizaiton AST (without committing payloads)', () => { + operation = createOperationDescriptor(AbstractClientQuery, {}); + environment.commitUpdate(store => { + const rootRecord = nullthrows(store.get(ROOT_ID)); + const clientObj = store.create( + '4', + 'OtherClientTypeImplementingClientInterface', + ); + clientObj.setValue('4', 'id'); + clientObj.setValue('My Description', 'description'); + rootRecord.setLinkedRecord(clientObj, 'client_interface'); + }); + // DataChecker similar to normalizer will put abstract type information to the record source. + // In the previouse test we use `commitPayload(...)` so the normalizer can assign these `abstract types`. + environment.check(operation); + const parentSnapshot: $FlowFixMe = environment.lookup(operation.fragment); + const fragmentSelector = nullthrows( + getSingularSelector( + AbstractClientInterfaceFragment, + parentSnapshot.data.client_interface, + ), + ); + const fragmentSnapshot = environment.lookup(fragmentSelector); + expect(fragmentSnapshot.data).toEqual({ + description: 'My Description', + }); + expect(fragmentSnapshot.isMissingData).toBe(false); + }); }); }); diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientAbstractQuery.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientAbstractQuery.graphql.js new file mode 100644 index 0000000000000..0ac1abf7b9922 --- /dev/null +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientAbstractQuery.graphql.js @@ -0,0 +1,125 @@ +/** + * 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. + * + * @generated SignedSource<> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { ClientRequest, ClientQuery } from 'relay-runtime'; +import type { DataCheckerTestClientInterface$fragmentType } from "./DataCheckerTestClientInterface.graphql"; +export type DataCheckerTestClientAbstractQuery$variables = {||}; +export type DataCheckerTestClientAbstractQuery$data = {| + +client_interface: ?{| + +$fragmentSpreads: DataCheckerTestClientInterface$fragmentType, + |}, +|}; +export type DataCheckerTestClientAbstractQuery = {| + response: DataCheckerTestClientAbstractQuery$data, + variables: DataCheckerTestClientAbstractQuery$variables, +|}; +*/ + +var node/*: ClientRequest*/ = { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "DataCheckerTestClientAbstractQuery", + "selections": [ + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "client_interface", + "plural": false, + "selections": [ + { + "args": null, + "kind": "FragmentSpread", + "name": "DataCheckerTestClientInterface" + } + ], + "storageKey": null + } + ] + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "DataCheckerTestClientAbstractQuery", + "selections": [ + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": null, + "kind": "LinkedField", + "name": "client_interface", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "__typename", + "storageKey": null + }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "description", + "storageKey": null + } + ], + "storageKey": null + } + ] + } + ], + "clientAbstractTypes": { + "__isClientInterface": [ + "ClientTypeImplementingClientInterface", + "OtherClientTypeImplementingClientInterface" + ] + } + }, + "params": { + "cacheID": "45e00d09635d463c054740359ede6a9c", + "id": null, + "metadata": {}, + "name": "DataCheckerTestClientAbstractQuery", + "operationKind": "query", + "text": null + } +}; + +if (__DEV__) { + (node/*: any*/).hash = "621e19afb09991109622110ee40f5f61"; +} + +module.exports = ((node/*: any*/)/*: ClientQuery< + DataCheckerTestClientAbstractQuery$variables, + DataCheckerTestClientAbstractQuery$data, +>*/); diff --git a/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientInterface.graphql.js b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientInterface.graphql.js new file mode 100644 index 0000000000000..139093af53a09 --- /dev/null +++ b/packages/relay-runtime/store/__tests__/__generated__/DataCheckerTestClientInterface.graphql.js @@ -0,0 +1,62 @@ +/** + * 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. + * + * @generated SignedSource<<5100ca8c6c84616144b97429e7b8ff8e>> + * @flow + * @lightSyntaxTransform + * @nogrep + */ + +/* eslint-disable */ + +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +import type { FragmentType } from "relay-runtime"; +declare export opaque type DataCheckerTestClientInterface$fragmentType: FragmentType; +export type DataCheckerTestClientInterface$data = {| + +description: ?string, + +$fragmentType: DataCheckerTestClientInterface$fragmentType, +|}; +export type DataCheckerTestClientInterface$key = { + +$data?: DataCheckerTestClientInterface$data, + +$fragmentSpreads: DataCheckerTestClientInterface$fragmentType, + ... +}; +*/ + +var node/*: ReaderFragment*/ = { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "DataCheckerTestClientInterface", + "selections": [ + { + "kind": "ClientExtension", + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "description", + "storageKey": null + } + ] + } + ], + "type": "ClientInterface", + "abstractKey": "__isClientInterface" +}; + +if (__DEV__) { + (node/*: any*/).hash = "4995889c6c2685693be9b60dccb0b095"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + DataCheckerTestClientInterface$fragmentType, + DataCheckerTestClientInterface$data, +>*/);