From 4b8b38bf7c55326f8d51ea9deeea76d7feee307d Mon Sep 17 00:00:00 2001 From: nagman Date: Tue, 30 Apr 2019 07:26:44 +0200 Subject: [PATCH] Update GraphQL doc (#6898) * Need to install graphql package * Need to provide real graphql in the .graphql file, not gql wrapped graphql --- docusaurus/docs/loading-graphql-files.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/docusaurus/docs/loading-graphql-files.md b/docusaurus/docs/loading-graphql-files.md index 423cbff3d3e..1d50dcc9875 100644 --- a/docusaurus/docs/loading-graphql-files.md +++ b/docusaurus/docs/loading-graphql-files.md @@ -4,16 +4,16 @@ title: Loading .graphql Files sidebar_label: Loading .graphql Files --- -To load `.gql` and `.graphql` files, first install the [`graphql.macro`](https://www.npmjs.com/package/graphql.macro) package by running: +To load `.gql` and `.graphql` files, first install the [`graphql`](https://www.npmjs.com/package/graphql) and [`graphql.macro`](https://www.npmjs.com/package/graphql.macro) packages by running: ```sh -npm install --save graphql.macro +npm install --save graphql graphql.macro ``` Alternatively you may use `yarn`: ```sh -yarn add graphql.macro +yarn add graphql graphql.macro ``` Then, whenever you want to load `.gql` or `.graphql` files, import the `loader` from the macro package: @@ -27,13 +27,11 @@ const query = loader('./foo.graphql'); And your results get automatically inlined! This means that if the file above, `foo.graphql`, contains the following: ```graphql -gql` - query { - hello { - world - } +query { + hello { + world } -`; +} ``` The previous example turns into: