From 979896df56889b1c6db5a687bff2546881cf4a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Wed, 31 Mar 2021 21:42:39 -0600 Subject: [PATCH] Universe: use Relay 13 and the new Rust Compiler This commit upgrades Relay to version 13 and switches from the old Relay Compiler to the new Rust one (since both things go together). Basically, the main change is that now we have only one Relay config for the whole monorepo and the compiler is being executed for the whole monorepo as well (while being much faster). Additionally, Relay support is directly integrated into Flow so in many cases I simply removed previous Flow types (see `useLazyLoadQuery` and `useFragment`). There is still ongoing effort to improve the Flow types in Relay so not everything is finalized. For this reason I decided to use "Compat" types mode. Similarly, some hooks (`useMutation` and `usePreloadedQuery` for example) still require explicit types information so I didn't change these yet. Regardless of that, we are pretty close to use "Final" types. We just need to wait for the Relay team to finish everything. Many issues were already resolved but there are still some that need to be fixed (not blocking this PR): - https://github.com/facebook/relay/pull/3700 - https://github.com/relayjs/eslint-plugin-relay/issues/131 - https://github.com/prettier/prettier/issues/6102 Important links with additional information: - https://relay.dev/blog/2021/12/08/introducing-the-new-relay-compiler/ - https://github.com/facebook/relay/releases/tag/v13.0.0 - https://github.com/facebook/relay/releases/tag/v13.0.0-rc.0 - https://github.com/facebook/relay/releases/tag/v13.0.0-rc.1 - https://github.com/facebook/relay/releases/tag/v13.0.0-rc.2 adeira-source-id: bc3d10741250e32b6fd399245f62d25484c6ae70 --- package.json | 3 +- relay.config.js | 6 - src/__generated__/MenuQuery.graphql.js | 114 +++++------------- src/menu/MenuSectionCoffee.js | 2 +- src/menu/MenuSectionKochkadaSavory.js | 2 +- src/menu/MenuSectionKochkadaSweet.js | 2 +- src/menu/MenuSectionMilkshake.js | 2 +- src/menu/MenuSectionSpecialities.js | 2 +- src/menu/MenuSectionTea.js | 2 +- .../MenuSectionCoffee.graphql.js | 43 ++++--- .../MenuSectionKochkadaSavory.graphql.js | 43 ++++--- .../MenuSectionKochkadaSweet.graphql.js | 43 ++++--- .../MenuSectionMilkshake.graphql.js | 43 ++++--- .../MenuSectionSpecialities.graphql.js | 43 ++++--- .../__generated__/MenuSectionTea.graphql.js | 43 ++++--- src/menu/components/MenuRow.js | 2 +- .../__generated__/MenuRow.graphql.js | 39 ++++-- .../ProductPageLayoutQuery.graphql.js | 57 ++++----- .../ShopLayoutContentQuery.graphql.js | 59 ++++----- 19 files changed, 285 insertions(+), 265 deletions(-) delete mode 100644 relay.config.js diff --git a/package.json b/package.json index da281d8..bc6c98e 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,7 @@ "fbt:manifest": "fbt-manifest --src=src --src=pages --enum-manifest=translations/enum_manifest.json --src-manifest=translations/src_manifest.json", "fbt:collect": "fbt-collect --options=__self --pretty --manifest < translations/src_manifest.json > translations/source_strings.json", "fbt:translate": "fbt-translate --source-strings=translations/source_strings.json --pretty --translations translations/in/*.json --output-dir=translations/out --jenkins", - "fbt": "yarn run fbt:manifest && yarn run fbt:collect && yarn run fbt:translate", - "relay": "adeira-relay-compiler" + "fbt": "yarn run fbt:manifest && yarn run fbt:collect && yarn run fbt:translate" }, "dependencies": { "@adeira/icons": "^1.0.1", diff --git a/relay.config.js b/relay.config.js deleted file mode 100644 index 9445fcf..0000000 --- a/relay.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// @flow strict - -module.exports = { - src: './src', - schema: '../abacus/schema.graphql', -}; diff --git a/src/__generated__/MenuQuery.graphql.js b/src/__generated__/MenuQuery.graphql.js index 1a20ea2..4d00812 100644 --- a/src/__generated__/MenuQuery.graphql.js +++ b/src/__generated__/MenuQuery.graphql.js @@ -1,97 +1,41 @@ /** + * @generated SignedSource<> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ConcreteRequest } from 'relay-runtime'; -type MenuSectionCoffee$ref = any; -type MenuSectionKochkadaSavory$ref = any; -type MenuSectionKochkadaSweet$ref = any; -type MenuSectionMilkshake$ref = any; -type MenuSectionSpecialities$ref = any; -type MenuSectionTea$ref = any; +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +type MenuSectionCoffee$fragmentType = any; +type MenuSectionKochkadaSavory$fragmentType = any; +type MenuSectionKochkadaSweet$fragmentType = any; +type MenuSectionMilkshake$fragmentType = any; +type MenuSectionSpecialities$fragmentType = any; +type MenuSectionTea$fragmentType = any; export type SupportedLocale = "en_US" | "es_MX" | "%future added value"; -export type MenuQueryVariables = {| - clientLocale: SupportedLocale +export type MenuQuery$variables = {| + clientLocale: SupportedLocale, |}; -export type MenuQueryResponse = {| +export type MenuQueryVariables = MenuQuery$variables; +export type MenuQuery$data = {| +menu: {| - +$fragmentRefs: MenuSectionCoffee$ref & MenuSectionTea$ref & MenuSectionMilkshake$ref & MenuSectionSpecialities$ref & MenuSectionKochkadaSweet$ref & MenuSectionKochkadaSavory$ref - |} + +$fragmentSpreads: MenuSectionCoffee$fragmentType & MenuSectionTea$fragmentType & MenuSectionMilkshake$fragmentType & MenuSectionSpecialities$fragmentType & MenuSectionKochkadaSweet$fragmentType & MenuSectionKochkadaSavory$fragmentType, + |}, |}; +export type MenuQueryResponse = MenuQuery$data; export type MenuQuery = {| variables: MenuQueryVariables, - response: MenuQueryResponse, + response: MenuQuery$data, |}; - -/* -query MenuQuery( - $clientLocale: SupportedLocale! -) { - menu { - ...MenuSectionCoffee - ...MenuSectionTea - ...MenuSectionMilkshake - ...MenuSectionSpecialities - ...MenuSectionKochkadaSweet - ...MenuSectionKochkadaSavory - } -} - -fragment MenuRow on Product { - name - description - price { - unitAmount - unitAmountCurrency - } -} - -fragment MenuSectionCoffee on MenuQuery { - coffeeMenu: menu(clientLocale: $clientLocale, section: COFFEE) { - id - ...MenuRow - } -} - -fragment MenuSectionKochkadaSavory on MenuQuery { - kochkadaSavoryMenu: menu(clientLocale: $clientLocale, section: DUMPLING_SAVORY) { - id - ...MenuRow - } -} - -fragment MenuSectionKochkadaSweet on MenuQuery { - kochkadaSweetMenu: menu(clientLocale: $clientLocale, section: DUMPLING_SWEET) { - id - ...MenuRow - } -} - -fragment MenuSectionMilkshake on MenuQuery { - milkshakesMenu: menu(clientLocale: $clientLocale, section: MILKSHAKES) { - id - ...MenuRow - } -} - -fragment MenuSectionSpecialities on MenuQuery { - specialitiesMenu: menu(clientLocale: $clientLocale, section: SPECIALITIES) { - id - ...MenuRow - } -} - -fragment MenuSectionTea on MenuQuery { - teaMenu: menu(clientLocale: $clientLocale, section: TEA) { - id - ...MenuRow - } -} */ -const node: ConcreteRequest = (function(){ +var node/*: ConcreteRequest*/ = (function(){ var v0 = [ { "defaultValue": null, @@ -335,6 +279,12 @@ return { } }; })(); -// prettier-ignore -(node: any).hash = 'fe5ebd8591713ee5370319d526a77ebd'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "fe5ebd8591713ee5370319d526a77ebd"; +} + +module.exports = ((node/*: any*/)/*: Query< + MenuQuery$variables, + MenuQuery$data, +>*/); diff --git a/src/menu/MenuSectionCoffee.js b/src/menu/MenuSectionCoffee.js index 0224deb..c193015 100644 --- a/src/menu/MenuSectionCoffee.js +++ b/src/menu/MenuSectionCoffee.js @@ -13,7 +13,7 @@ type Props = { }; export default function MenuSectionCoffee(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuSectionCoffee on MenuQuery { coffeeMenu: menu(clientLocale: $clientLocale, section: COFFEE) { diff --git a/src/menu/MenuSectionKochkadaSavory.js b/src/menu/MenuSectionKochkadaSavory.js index 2f10e5b..a7f5c80 100644 --- a/src/menu/MenuSectionKochkadaSavory.js +++ b/src/menu/MenuSectionKochkadaSavory.js @@ -13,7 +13,7 @@ type Props = { }; export default function MenuSectionKochkadaSavory(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuSectionKochkadaSavory on MenuQuery { kochkadaSavoryMenu: menu(clientLocale: $clientLocale, section: DUMPLING_SAVORY) { diff --git a/src/menu/MenuSectionKochkadaSweet.js b/src/menu/MenuSectionKochkadaSweet.js index 151ab18..29125a3 100644 --- a/src/menu/MenuSectionKochkadaSweet.js +++ b/src/menu/MenuSectionKochkadaSweet.js @@ -13,7 +13,7 @@ type Props = { }; export default function MenuSectionKochkadaSweet(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuSectionKochkadaSweet on MenuQuery { kochkadaSweetMenu: menu(clientLocale: $clientLocale, section: DUMPLING_SWEET) { diff --git a/src/menu/MenuSectionMilkshake.js b/src/menu/MenuSectionMilkshake.js index b083a30..2388e83 100644 --- a/src/menu/MenuSectionMilkshake.js +++ b/src/menu/MenuSectionMilkshake.js @@ -13,7 +13,7 @@ type Props = { }; export default function MenuSectionMilkshake(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuSectionMilkshake on MenuQuery { milkshakesMenu: menu(clientLocale: $clientLocale, section: MILKSHAKES) { diff --git a/src/menu/MenuSectionSpecialities.js b/src/menu/MenuSectionSpecialities.js index e6a99d8..27fd804 100644 --- a/src/menu/MenuSectionSpecialities.js +++ b/src/menu/MenuSectionSpecialities.js @@ -13,7 +13,7 @@ type Props = { }; export default function MenuSectionSpecialities(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuSectionSpecialities on MenuQuery { specialitiesMenu: menu(clientLocale: $clientLocale, section: SPECIALITIES) { diff --git a/src/menu/MenuSectionTea.js b/src/menu/MenuSectionTea.js index 99aed24..5073bab 100644 --- a/src/menu/MenuSectionTea.js +++ b/src/menu/MenuSectionTea.js @@ -13,7 +13,7 @@ type Props = { }; export default function MenuSectionTea(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuSectionTea on MenuQuery { teaMenu: menu(clientLocale: $clientLocale, section: TEA) { diff --git a/src/menu/__generated__/MenuSectionCoffee.graphql.js b/src/menu/__generated__/MenuSectionCoffee.graphql.js index 56d693f..7a96640 100644 --- a/src/menu/__generated__/MenuSectionCoffee.graphql.js +++ b/src/menu/__generated__/MenuSectionCoffee.graphql.js @@ -1,30 +1,37 @@ /** + * @generated SignedSource<> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; -type MenuRow$ref = any; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuSectionCoffee$ref: FragmentReference; -declare export opaque type MenuSectionCoffee$fragmentType: MenuSectionCoffee$ref; -export type MenuSectionCoffee = {| +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +type MenuRow$fragmentType = any; +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuSectionCoffee$fragmentType: FragmentType; +export type MenuSectionCoffee$ref = MenuSectionCoffee$fragmentType; +export type MenuSectionCoffee$data = {| +coffeeMenu: $ReadOnlyArray<{| +id: string, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, |}>, - +$refType: MenuSectionCoffee$ref, + +$fragmentType: MenuSectionCoffee$fragmentType, |}; -export type MenuSectionCoffee$data = MenuSectionCoffee; +export type MenuSectionCoffee = MenuSectionCoffee$data; export type MenuSectionCoffee$key = { +$data?: MenuSectionCoffee$data, - +$fragmentRefs: MenuSectionCoffee$ref, + +$fragmentSpreads: MenuSectionCoffee$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [ { "kind": "RootArgument", @@ -73,6 +80,12 @@ const node: ReaderFragment = { "type": "MenuQuery", "abstractKey": null }; -// prettier-ignore -(node: any).hash = '4f389377a25c5b78515dc2effd798653'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "4f389377a25c5b78515dc2effd798653"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuSectionCoffee$fragmentType, + MenuSectionCoffee$data, +>*/); diff --git a/src/menu/__generated__/MenuSectionKochkadaSavory.graphql.js b/src/menu/__generated__/MenuSectionKochkadaSavory.graphql.js index d52a7ad..45af86b 100644 --- a/src/menu/__generated__/MenuSectionKochkadaSavory.graphql.js +++ b/src/menu/__generated__/MenuSectionKochkadaSavory.graphql.js @@ -1,30 +1,37 @@ /** + * @generated SignedSource<> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; -type MenuRow$ref = any; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuSectionKochkadaSavory$ref: FragmentReference; -declare export opaque type MenuSectionKochkadaSavory$fragmentType: MenuSectionKochkadaSavory$ref; -export type MenuSectionKochkadaSavory = {| +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +type MenuRow$fragmentType = any; +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuSectionKochkadaSavory$fragmentType: FragmentType; +export type MenuSectionKochkadaSavory$ref = MenuSectionKochkadaSavory$fragmentType; +export type MenuSectionKochkadaSavory$data = {| +kochkadaSavoryMenu: $ReadOnlyArray<{| +id: string, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, |}>, - +$refType: MenuSectionKochkadaSavory$ref, + +$fragmentType: MenuSectionKochkadaSavory$fragmentType, |}; -export type MenuSectionKochkadaSavory$data = MenuSectionKochkadaSavory; +export type MenuSectionKochkadaSavory = MenuSectionKochkadaSavory$data; export type MenuSectionKochkadaSavory$key = { +$data?: MenuSectionKochkadaSavory$data, - +$fragmentRefs: MenuSectionKochkadaSavory$ref, + +$fragmentSpreads: MenuSectionKochkadaSavory$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [ { "kind": "RootArgument", @@ -73,6 +80,12 @@ const node: ReaderFragment = { "type": "MenuQuery", "abstractKey": null }; -// prettier-ignore -(node: any).hash = '6140475a005f70edc685bfd546178cf4'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "6140475a005f70edc685bfd546178cf4"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuSectionKochkadaSavory$fragmentType, + MenuSectionKochkadaSavory$data, +>*/); diff --git a/src/menu/__generated__/MenuSectionKochkadaSweet.graphql.js b/src/menu/__generated__/MenuSectionKochkadaSweet.graphql.js index 2104c74..3d6c023 100644 --- a/src/menu/__generated__/MenuSectionKochkadaSweet.graphql.js +++ b/src/menu/__generated__/MenuSectionKochkadaSweet.graphql.js @@ -1,30 +1,37 @@ /** + * @generated SignedSource<> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; -type MenuRow$ref = any; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuSectionKochkadaSweet$ref: FragmentReference; -declare export opaque type MenuSectionKochkadaSweet$fragmentType: MenuSectionKochkadaSweet$ref; -export type MenuSectionKochkadaSweet = {| +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +type MenuRow$fragmentType = any; +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuSectionKochkadaSweet$fragmentType: FragmentType; +export type MenuSectionKochkadaSweet$ref = MenuSectionKochkadaSweet$fragmentType; +export type MenuSectionKochkadaSweet$data = {| +kochkadaSweetMenu: $ReadOnlyArray<{| +id: string, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, |}>, - +$refType: MenuSectionKochkadaSweet$ref, + +$fragmentType: MenuSectionKochkadaSweet$fragmentType, |}; -export type MenuSectionKochkadaSweet$data = MenuSectionKochkadaSweet; +export type MenuSectionKochkadaSweet = MenuSectionKochkadaSweet$data; export type MenuSectionKochkadaSweet$key = { +$data?: MenuSectionKochkadaSweet$data, - +$fragmentRefs: MenuSectionKochkadaSweet$ref, + +$fragmentSpreads: MenuSectionKochkadaSweet$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [ { "kind": "RootArgument", @@ -73,6 +80,12 @@ const node: ReaderFragment = { "type": "MenuQuery", "abstractKey": null }; -// prettier-ignore -(node: any).hash = 'f986851f1127acd1499898269a9038c3'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "f986851f1127acd1499898269a9038c3"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuSectionKochkadaSweet$fragmentType, + MenuSectionKochkadaSweet$data, +>*/); diff --git a/src/menu/__generated__/MenuSectionMilkshake.graphql.js b/src/menu/__generated__/MenuSectionMilkshake.graphql.js index 94d1176..0033bfa 100644 --- a/src/menu/__generated__/MenuSectionMilkshake.graphql.js +++ b/src/menu/__generated__/MenuSectionMilkshake.graphql.js @@ -1,30 +1,37 @@ /** + * @generated SignedSource<<39957e4bdd4a83d74cd8545f4346ba4b>> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; -type MenuRow$ref = any; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuSectionMilkshake$ref: FragmentReference; -declare export opaque type MenuSectionMilkshake$fragmentType: MenuSectionMilkshake$ref; -export type MenuSectionMilkshake = {| +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +type MenuRow$fragmentType = any; +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuSectionMilkshake$fragmentType: FragmentType; +export type MenuSectionMilkshake$ref = MenuSectionMilkshake$fragmentType; +export type MenuSectionMilkshake$data = {| +milkshakesMenu: $ReadOnlyArray<{| +id: string, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, |}>, - +$refType: MenuSectionMilkshake$ref, + +$fragmentType: MenuSectionMilkshake$fragmentType, |}; -export type MenuSectionMilkshake$data = MenuSectionMilkshake; +export type MenuSectionMilkshake = MenuSectionMilkshake$data; export type MenuSectionMilkshake$key = { +$data?: MenuSectionMilkshake$data, - +$fragmentRefs: MenuSectionMilkshake$ref, + +$fragmentSpreads: MenuSectionMilkshake$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [ { "kind": "RootArgument", @@ -73,6 +80,12 @@ const node: ReaderFragment = { "type": "MenuQuery", "abstractKey": null }; -// prettier-ignore -(node: any).hash = 'd1cc28eedfba9f309564bf01b958dc15'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "d1cc28eedfba9f309564bf01b958dc15"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuSectionMilkshake$fragmentType, + MenuSectionMilkshake$data, +>*/); diff --git a/src/menu/__generated__/MenuSectionSpecialities.graphql.js b/src/menu/__generated__/MenuSectionSpecialities.graphql.js index 6987e97..d7fb97d 100644 --- a/src/menu/__generated__/MenuSectionSpecialities.graphql.js +++ b/src/menu/__generated__/MenuSectionSpecialities.graphql.js @@ -1,30 +1,37 @@ /** + * @generated SignedSource<<8d569e89668800460d221617d35a3ace>> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; -type MenuRow$ref = any; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuSectionSpecialities$ref: FragmentReference; -declare export opaque type MenuSectionSpecialities$fragmentType: MenuSectionSpecialities$ref; -export type MenuSectionSpecialities = {| +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +type MenuRow$fragmentType = any; +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuSectionSpecialities$fragmentType: FragmentType; +export type MenuSectionSpecialities$ref = MenuSectionSpecialities$fragmentType; +export type MenuSectionSpecialities$data = {| +specialitiesMenu: $ReadOnlyArray<{| +id: string, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, |}>, - +$refType: MenuSectionSpecialities$ref, + +$fragmentType: MenuSectionSpecialities$fragmentType, |}; -export type MenuSectionSpecialities$data = MenuSectionSpecialities; +export type MenuSectionSpecialities = MenuSectionSpecialities$data; export type MenuSectionSpecialities$key = { +$data?: MenuSectionSpecialities$data, - +$fragmentRefs: MenuSectionSpecialities$ref, + +$fragmentSpreads: MenuSectionSpecialities$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [ { "kind": "RootArgument", @@ -73,6 +80,12 @@ const node: ReaderFragment = { "type": "MenuQuery", "abstractKey": null }; -// prettier-ignore -(node: any).hash = '588f863b6281b508dc66297669402400'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "588f863b6281b508dc66297669402400"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuSectionSpecialities$fragmentType, + MenuSectionSpecialities$data, +>*/); diff --git a/src/menu/__generated__/MenuSectionTea.graphql.js b/src/menu/__generated__/MenuSectionTea.graphql.js index 7bbf9ae..a9b4b83 100644 --- a/src/menu/__generated__/MenuSectionTea.graphql.js +++ b/src/menu/__generated__/MenuSectionTea.graphql.js @@ -1,30 +1,37 @@ /** + * @generated SignedSource<> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; -type MenuRow$ref = any; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuSectionTea$ref: FragmentReference; -declare export opaque type MenuSectionTea$fragmentType: MenuSectionTea$ref; -export type MenuSectionTea = {| +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; +type MenuRow$fragmentType = any; +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuSectionTea$fragmentType: FragmentType; +export type MenuSectionTea$ref = MenuSectionTea$fragmentType; +export type MenuSectionTea$data = {| +teaMenu: $ReadOnlyArray<{| +id: string, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, |}>, - +$refType: MenuSectionTea$ref, + +$fragmentType: MenuSectionTea$fragmentType, |}; -export type MenuSectionTea$data = MenuSectionTea; +export type MenuSectionTea = MenuSectionTea$data; export type MenuSectionTea$key = { +$data?: MenuSectionTea$data, - +$fragmentRefs: MenuSectionTea$ref, + +$fragmentSpreads: MenuSectionTea$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [ { "kind": "RootArgument", @@ -73,6 +80,12 @@ const node: ReaderFragment = { "type": "MenuQuery", "abstractKey": null }; -// prettier-ignore -(node: any).hash = 'ba30927cc521f851bada3d3e03b5f41a'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "ba30927cc521f851bada3d3e03b5f41a"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuSectionTea$fragmentType, + MenuSectionTea$data, +>*/); diff --git a/src/menu/components/MenuRow.js b/src/menu/components/MenuRow.js index ac3992b..827577d 100644 --- a/src/menu/components/MenuRow.js +++ b/src/menu/components/MenuRow.js @@ -12,7 +12,7 @@ type Props = { }; export default function MenuRow(props: Props): Node { - const data = useFragment( + const data = useFragment( graphql` fragment MenuRow on Product { name diff --git a/src/menu/components/__generated__/MenuRow.graphql.js b/src/menu/components/__generated__/MenuRow.graphql.js index ace7e6b..babeced 100644 --- a/src/menu/components/__generated__/MenuRow.graphql.js +++ b/src/menu/components/__generated__/MenuRow.graphql.js @@ -1,32 +1,39 @@ /** + * @generated SignedSource<<56b794f7eb6a38dea061e183f50ff958>> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ReaderFragment } from 'relay-runtime'; +'use strict'; + +/*:: +import type { Fragment, ReaderFragment } from 'relay-runtime'; export type SupportedCurrency = "MXN" | "%future added value"; -import type { FragmentReference } from "relay-runtime"; -declare export opaque type MenuRow$ref: FragmentReference; -declare export opaque type MenuRow$fragmentType: MenuRow$ref; -export type MenuRow = {| +import type { FragmentType } from "relay-runtime"; +declare export opaque type MenuRow$fragmentType: FragmentType; +export type MenuRow$ref = MenuRow$fragmentType; +export type MenuRow$data = {| +name: string, +description: ?string, +price: {| +unitAmount: number, +unitAmountCurrency: SupportedCurrency, |}, - +$refType: MenuRow$ref, + +$fragmentType: MenuRow$fragmentType, |}; -export type MenuRow$data = MenuRow; +export type MenuRow = MenuRow$data; export type MenuRow$key = { +$data?: MenuRow$data, - +$fragmentRefs: MenuRow$ref, + +$fragmentSpreads: MenuRow$fragmentType, ... }; +*/ - -const node: ReaderFragment = { +var node/*: ReaderFragment*/ = { "argumentDefinitions": [], "kind": "Fragment", "metadata": null, @@ -75,6 +82,12 @@ const node: ReaderFragment = { "type": "Product", "abstractKey": null }; -// prettier-ignore -(node: any).hash = '0dfe65ad52cd8b7bd967d49f64ed44f9'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "0dfe65ad52cd8b7bd967d49f64ed44f9"; +} + +module.exports = ((node/*: any*/)/*: Fragment< + MenuRow$fragmentType, + MenuRow$data, +>*/); diff --git a/src/shop/__generated__/ProductPageLayoutQuery.graphql.js b/src/shop/__generated__/ProductPageLayoutQuery.graphql.js index 9ac3d45..da748c3 100644 --- a/src/shop/__generated__/ProductPageLayoutQuery.graphql.js +++ b/src/shop/__generated__/ProductPageLayoutQuery.graphql.js @@ -1,17 +1,25 @@ /** + * @generated SignedSource<<97947a74a397b0a87cf8b59e4770bdaa>> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ConcreteRequest } from 'relay-runtime'; +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; export type SupportedCurrency = "MXN" | "%future added value"; export type SupportedLocale = "en_US" | "es_MX" | "%future added value"; -export type ProductPageLayoutQueryVariables = {| +export type ProductPageLayoutQuery$variables = {| clientLocale: SupportedLocale, productKey: string, |}; -export type ProductPageLayoutQueryResponse = {| +export type ProductPageLayoutQueryVariables = ProductPageLayoutQuery$variables; +export type ProductPageLayoutQuery$data = {| +commerce: {| +product: {| +name: string, @@ -24,38 +32,17 @@ export type ProductPageLayoutQueryResponse = {| +blurhash: string, +url: string, |}>, - |} - |} + |}, + |}, |}; +export type ProductPageLayoutQueryResponse = ProductPageLayoutQuery$data; export type ProductPageLayoutQuery = {| variables: ProductPageLayoutQueryVariables, - response: ProductPageLayoutQueryResponse, + response: ProductPageLayoutQuery$data, |}; - -/* -query ProductPageLayoutQuery( - $clientLocale: SupportedLocale! - $productKey: ID! -) { - commerce { - product: getPublishedProductByKey(clientLocale: $clientLocale, productKey: $productKey) { - name - description - price { - unitAmount - unitAmountCurrency - } - images { - blurhash - url - } - id - } - } -} */ -const node: ConcreteRequest = (function(){ +var node/*: ConcreteRequest*/ = (function(){ var v0 = [ { "defaultValue": null, @@ -232,6 +219,12 @@ return { } }; })(); -// prettier-ignore -(node: any).hash = '860c513cb31bbfc2af9dcf31be1b0b33'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "25a2ea0e1e939f54047f9222193604a7"; +} + +module.exports = ((node/*: any*/)/*: Query< + ProductPageLayoutQuery$variables, + ProductPageLayoutQuery$data, +>*/); diff --git a/src/shop/__generated__/ShopLayoutContentQuery.graphql.js b/src/shop/__generated__/ShopLayoutContentQuery.graphql.js index 8d9bcc5..f79e5ce 100644 --- a/src/shop/__generated__/ShopLayoutContentQuery.graphql.js +++ b/src/shop/__generated__/ShopLayoutContentQuery.graphql.js @@ -1,18 +1,26 @@ /** + * @generated SignedSource<> * @flow + * @lightSyntaxTransform + * @nogrep + * @codegen-command: ./node_modules/.bin/relay-compiler */ /* eslint-disable */ -import type { ConcreteRequest } from 'relay-runtime'; -export type PriceSortDirection = "HIGH_TO_LOW" | "LOW_TO_HIGH" | "%future added value"; +'use strict'; + +/*:: +import type { ConcreteRequest, Query } from 'relay-runtime'; +export type PriceSortDirection = "LOW_TO_HIGH" | "HIGH_TO_LOW" | "%future added value"; export type SupportedCurrency = "MXN" | "%future added value"; export type SupportedLocale = "en_US" | "es_MX" | "%future added value"; -export type ShopLayoutContentQueryVariables = {| +export type ShopLayoutContentQuery$variables = {| clientLocale: SupportedLocale, priceSortDirection: PriceSortDirection, |}; -export type ShopLayoutContentQueryResponse = {| +export type ShopLayoutContentQueryVariables = ShopLayoutContentQuery$variables; +export type ShopLayoutContentQuery$data = {| +commerce: {| +products: $ReadOnlyArray - |} + |}>, + |}, |}; +export type ShopLayoutContentQueryResponse = ShopLayoutContentQuery$data; export type ShopLayoutContentQuery = {| variables: ShopLayoutContentQueryVariables, - response: ShopLayoutContentQueryResponse, + response: ShopLayoutContentQuery$data, |}; - -/* -query ShopLayoutContentQuery( - $clientLocale: SupportedLocale! - $priceSortDirection: PriceSortDirection! -) { - commerce { - products: searchAllPublishedProducts(clientLocale: $clientLocale, priceSortDirection: $priceSortDirection, visibility: ESHOP) { - key - name - price { - unitAmount - unitAmountCurrency - } - imageCover { - blurhash - url - } - id - } - } -} */ -const node: ConcreteRequest = (function(){ +var node/*: ConcreteRequest*/ = (function(){ var v0 = [ { "defaultValue": null, @@ -238,6 +225,12 @@ return { } }; })(); -// prettier-ignore -(node: any).hash = 'f80231d0ee8d704c6ff74da317ee886a'; -export default node; + +if (__DEV__) { + (node/*: any*/).hash = "58597fd12ee384ee575ed69c889885a3"; +} + +module.exports = ((node/*: any*/)/*: Query< + ShopLayoutContentQuery$variables, + ShopLayoutContentQuery$data, +>*/);