Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ardatan/graphql-tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @graphql-tools/merge@6.2.14
Choose a base ref
...
head repository: ardatan/graphql-tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @graphql-tools/merge@6.2.15
Choose a head ref

Commits on May 11, 2021

  1. chore(deps): update dependency @apollo/client to v3.3.17 (#2947)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 11, 2021
    Copy the full SHA
    5791549 View commit details
  2. [deploy_website] chore(deps): update dependency typedoc-plugin-markdo…

    …wn to v3.8.1 (#2948)
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 11, 2021
    Copy the full SHA
    6cc574b View commit details

Commits on May 12, 2021

  1. chore(deps): update dependency @types/lodash to v4.14.169 (#2949)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 12, 2021
    Copy the full SHA
    41a4dc7 View commit details
  2. fix(deps): update docusaurus monorepo to v2.0.0-beta.0 (#2952)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 12, 2021
    Copy the full SHA
    94ce8c8 View commit details
  3. chore(deps): update babel monorepo to v7.14.2 (#2953)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 12, 2021
    Copy the full SHA
    3636e51 View commit details
  4. Copy the full SHA
    b3e0772 View commit details
  5. chore(deps): update dependency @types/node to v14.14.45 (#2954)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 12, 2021
    Copy the full SHA
    3062612 View commit details

Commits on May 13, 2021

  1. Make executors not generic over context types (#2958)

    * Make executors not generic over context types
    
    See #2749 and
    58fd4b2
    for some history.
    
    There's still one more problem however: an Executor is still a generic
    function over any possible context type. <TContext = TBaseContext>
    merely sets a default if the function is called without explicit type
    arguments, but implementation is still required to work with any other
    type that may be passed for `TContext`.
    
    Since context exists to hold application-specific information, requiring
    executors to be generic is not useful. An application's implementation
    of resolvers, executors, subscribers, etc. will only work with that
    application's context type and can't be generic.
    
    add changeset
    
    * extend TBaseContext
    bitglue authored May 13, 2021
    Copy the full SHA
    e632c5d View commit details
  2. fix(deps): update dependency apollo-upload-client to v15 (#2957)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 13, 2021
    Copy the full SHA
    64b73d6 View commit details
  3. Copy the full SHA
    99f092f View commit details
  4. chore(release): update monorepo packages versions (#2959)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored May 13, 2021
    Copy the full SHA
    84ec8b9 View commit details
  5. chore(deps): update dependency @apollo/client to v3.3.18 (#2961)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 13, 2021
    Copy the full SHA
    5329205 View commit details

Commits on May 14, 2021

  1. chore(deps): update dependency eslint-plugin-import to v2.23.0 (#2962)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 14, 2021
    Copy the full SHA
    7e71e98 View commit details
  2. fix(deps): update docusaurus monorepo to v2.0.0-beta.01adf25b0 (#2964)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 14, 2021
    Copy the full SHA
    410f3af View commit details
  3. fix(deps): update docusaurus monorepo to v2.0.0-beta.e09291062 (#2965)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 14, 2021
    Copy the full SHA
    97ac926 View commit details

Commits on May 15, 2021

  1. chore(deps): update dependency eslint-plugin-import to v2.23.1 (#2966)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 15, 2021
    Copy the full SHA
    f733cac View commit details
  2. chore(deps): update dependency eslint-plugin-import to v2.23.2 (#2967)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 15, 2021
    Copy the full SHA
    9a780f5 View commit details

Commits on May 16, 2021

  1. refactor (#2968)

    yaacovCR authored May 16, 2021
    Copy the full SHA
    1fc1cb5 View commit details

Commits on May 17, 2021

  1. chore(deps): update dependency graphql-helix to v1.6.0 (#2973)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 17, 2021
    Copy the full SHA
    7d215fa View commit details
  2. typo (#2971)

    Fixed a simple typo
    flashspys authored May 17, 2021
    Copy the full SHA
    14c1907 View commit details
  3. chore(deps): update babel monorepo to v7.14.3 (#2974)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 17, 2021
    Copy the full SHA
    37f9a5a View commit details
  4. chore(deps): update typescript-eslint monorepo to v4.24.0 (#2972)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 17, 2021
    Copy the full SHA
    3c7ef7d View commit details

Commits on May 18, 2021

  1. fix(deps): update docusaurus monorepo to v2.0.0-beta.fa7aa0810 (#2975)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 18, 2021
    Copy the full SHA
    ab03d16 View commit details
  2. chore(deps): update dependency @types/node to v14.17.0 (#2976)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 18, 2021
    Copy the full SHA
    cea875d View commit details
  3. chore(deps): update dependency @apollo/client to v3.3.19 (#2979)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 18, 2021
    Copy the full SHA
    a23717e View commit details

Commits on May 21, 2021

  1. chore(deps): update dependency graphql-helix to v1.6.1 (#2981)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 21, 2021
    Copy the full SHA
    34263d9 View commit details
  2. chore(deps): update dependency @types/lodash to v4.14.170 (#2983)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 21, 2021
    Copy the full SHA
    8ce2706 View commit details
  3. fix(deps): update docusaurus monorepo to v2.0.0-beta.ff31de0ff (#2984)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 21, 2021
    Copy the full SHA
    5fd1898 View commit details
  4. chore(deps): update dependency eslint-plugin-import to v2.23.3 (#2986)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 21, 2021
    Copy the full SHA
    a8a03dc View commit details

Commits on May 22, 2021

  1. chore(deps): update dependency eslint to v7.27.0 (#2987)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 22, 2021
    Copy the full SHA
    4d526f9 View commit details
  2. fix(deps): update dependency dotenv to v10 (#2985)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 22, 2021
    Copy the full SHA
    456373b View commit details
  3. fix(deps): update dependency @types/http-proxy-agent to v4 (#2982)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 22, 2021
    Copy the full SHA
    2eb8bef View commit details

Commits on May 24, 2021

  1. chore(deps): update dependency concurrently to v6.2.0 (#2988)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 24, 2021
    Copy the full SHA
    62bc64d View commit details
  2. chore(deps): update dependency eslint-config-standard to v16.0.3 (#2989)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 24, 2021
    Copy the full SHA
    f0359b5 View commit details
  3. chore(deps): update typescript-eslint monorepo to v4.25.0 (#2990)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 24, 2021
    Copy the full SHA
    c5d3b71 View commit details
  4. fix(deps): update dependency the-guild-components to v1.0.16 (#2991)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 24, 2021
    Copy the full SHA
    b9a2ff6 View commit details

Commits on May 25, 2021

  1. chore(deps): update dependency @types/node to v14.17.1 (#2992)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 25, 2021
    Copy the full SHA
    9b0e972 View commit details
  2. chore(deps): update jest monorepo to v27 (major) (#2995)

    * chore(deps): update jest monorepo to v27
    
    * Fix tests
    
    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
    3 people authored May 25, 2021
    Copy the full SHA
    608405c View commit details
  3. Copy the full SHA
    2d090d3 View commit details
  4. chore(deps): update jest monorepo to v27.0.1 (#2998)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 25, 2021
    Copy the full SHA
    268c65a View commit details
  5. Copy the full SHA
    12a892e View commit details
  6. Copy the full SHA
    6a69337 View commit details
  7. Copy the full SHA
    8852a1b View commit details
  8. fix(deps): update dependency ws to v7.4.6 (#3000)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 25, 2021
    Copy the full SHA
    1bf0b1c View commit details

Commits on May 26, 2021

  1. chore(deps): update dependency typedoc-plugin-markdown to v3.8.2 (#3003)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 26, 2021
    Copy the full SHA
    5497d1c View commit details
  2. chore(deps): update dependency ts-jest to v27 (#3001)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 26, 2021
    Copy the full SHA
    5cd9f67 View commit details
  3. chore(deps): update dependency typescript to v4.3.2 (#3006)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 26, 2021
    Copy the full SHA
    c3af9a0 View commit details

Commits on May 27, 2021

  1. chore(deps): update dependency ts-jest to v27.0.1 (#3008)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 27, 2021
    Copy the full SHA
    fe3a6b1 View commit details
  2. chore(husky): finish migration (#3007)

    configuration changed, ran the 4 to 6 tool
    https://typicode.github.io/husky/\#/\?id\=husky-4-to-6-cli
    PixnBits authored May 27, 2021
    Copy the full SHA
    d410126 View commit details
  3. dedupe yarn deps (#3009)

    * feat: enxure renovate runs `npx yarn-deduplicate --strategy fewer` after upgrading a dependency
    
    * chore: run `npx yarn-deduplicate --strategy fewer`
    n1ru4l authored May 27, 2021
    Copy the full SHA
    9fe4598 View commit details
Showing 443 changed files with 19,706 additions and 19,516 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -61,7 +61,8 @@
"packages/load/tests/loaders/schema",
"website",
"scripts",
"packages/loaders/code-file/tests/test-files"
"packages/loaders/code-file/tests/test-files",
"packages/loaders/git/tests/test-files"
],
"globals":{
"BigInt": true
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -3,3 +3,6 @@ contact_links:
- name: Have a question?
url: https://github.com/ardatan/graphql-tools/discussions/new
about: Not sure about something? need help from the community? have a question to our team? please ask and answer questions here.
- name: Any issue with `npm audit`
url: https://overreacted.io/npm-audit-broken-by-design/
about: Please do not create issues about `npm audit` and you can contact with us directly for more questions.
52 changes: 52 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Benchmark

on:
pull_request: {}
workflow_dispatch: {}

jobs:
federation-benchmark:
name: Federation Benchmark with ${{matrix.products_size}} Products
runs-on: ubuntu-latest
strategy:
matrix:
products_size: [3, 10, 50, 100, 1000]
steps:
- name: Checkout Master
uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@master
with:
node-version: 16
- name: Cache Yarn
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-16-16-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-16-yarn
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Build
run: yarn build
- name: Setup K6
run: |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update
sudo apt-get install k6
- name: GraphQL API
working-directory: ./benchmark/federation
run: |
yarn start &
yarn wait-on tcp:3000
env:
PRODUCTS_SIZE: ${{matrix.products_size}}
- name: Federation
run: k6 -e ENDPOINT=federation run --out json=federation.json benchmark/federation/k6.js
- name: Stitching
run: k6 -e ENDPOINT=stitching run --out json=stitching.json benchmark/federation/k6.js
- name: Monolith
run: k6 -e ENDPOINT=monolith run --out json=monolith.json benchmark/federation/k6.js
- name: Compare
run: node benchmark/compare monolith:monolith.json federation:federation.json stitching:stitching.json
20 changes: 18 additions & 2 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -4,12 +4,24 @@ on:
pull_request:
branches:
- master

workflow_dispatch:
inputs:
onDemand:
description: 'Are you sure?'
required: true
default: 'yes'
npmTag:
description: 'NPM Tag'
required: true
default: 'alpha'
npmVersionSuffix:
description: 'Custom NPM Version Suffix'
required: false
jobs:
publish-canary:
name: Publish Canary
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
if: github.event.pull_request.head.repo.full_name == github.repository || github.event.inputs.onDemand == 'yes'
steps:
- name: Checkout Master
uses: actions/checkout@v2
@@ -44,6 +56,10 @@ jobs:
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
npm-script: 'yarn release:canary'
changesets: true
env:
ON_DEMAND: ${{github.event.inputs.onDemand}}
NPM_TAG: ${{github.event.inputs.npmTag || 'alpha'}}
NPM_VERSION_SUFFIX: ${{github.event.inputs.npmVersionSuffix}}
- name: Publish a message
if: steps.canary.outputs.released
uses: 'kamilkisiela/pr-comment@master'
69 changes: 69 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ jobs:
- name: Lint
run: yarn lint
build:
name: Build on ${{matrix.os}} GraphQL v${{matrix.graphql_version}}
name: Type Check on GraphQL v${{matrix.graphql_version}}
runs-on: ubuntu-latest
strategy:
matrix:
@@ -55,15 +55,19 @@ jobs:
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Build
run: yarn ts:transpile
run: yarn ts:check
test:
name: Test on ${{matrix.os}}, Node ${{matrix.node_version}} and GraphQL v${{matrix.graphql_version}}
name: Unit Test on Node ${{matrix.node_version}} (${{matrix.os}}) and GraphQL v${{matrix.graphql_version}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node_version: [10, 16]
os: [ubuntu-latest] # remove windows to speed up the tests
node_version: [12, 16]
graphql_version: [14, 15]
include:
- node_version: 14
os: windows-latest
graphql_version: 15
steps:
- name: Checkout Master
uses: actions/checkout@v2
2 changes: 2 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -35,6 +35,8 @@ jobs:
key: ${{ runner.os }}-16-16-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-16-16-yarn-
- name: Align TypeScript version with typedoc
run: node scripts/install-typedocs-typescript-version.js
- name: Install Dependencies using Yarn
run: yarn install --ignore-engines && git checkout yarn.lock
- name: Deploy 🚀
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
35 changes: 35 additions & 0 deletions benchmark/compare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const fs = require('fs');
const path = require('path');
let [, , ...rawPointers] = process.argv;

function createReport(pointer) {
const [name, file] = pointer.split(':');

const lines = fs.readFileSync(path.join(process.cwd(), file), 'utf-8').split('\n');

let sum = 0;
let count = 0;

for (let line of lines) {
if (line.trim().length) {
const metric = JSON.parse(line);

if (metric.type === 'Point' && metric.metric === 'http_req_duration' && metric.data.tags.status === '200') {
count++;
sum += metric.data.value;
}
}
}

return {
name,
file,
avg: sum / count,
};
}

const pointers = rawPointers.map(createReport);

const stats = pointers.map(pointer => `${pointer.name}: ${pointer.avg.toFixed(2)} ms`).join('\n')

console.log(stats);
53 changes: 53 additions & 0 deletions benchmark/federation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# environment variables
.env
14 changes: 14 additions & 0 deletions benchmark/federation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# federation-benchmark

## 0.0.1
### Patch Changes

- Updated dependencies [91155ab6]
- Updated dependencies [7d3e3006]
- Updated dependencies [dae6dc7b]
- Updated dependencies [1b0ce2ae]
- Updated dependencies [74581cf3]
- Updated dependencies [70cd65eb]
- Updated dependencies [c0ca3190]
- @graphql-tools/stitch@8.0.0
- @graphql-tools/stitching-directives@2.0.0
54 changes: 54 additions & 0 deletions benchmark/federation/call.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const fetch = require('cross-fetch');

fetch('http://localhost:3000/stitching', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({
query: /* GraphQL */ `
fragment User on User {
id
username
name
}
fragment Review on Review {
id
body
}
fragment Product on Product {
inStock
name
price
shippingEstimate
upc
weight
}
query TestQuery {
users {
...User
reviews {
...Review
product {
...Product
}
}
}
topProducts {
...Product
reviews {
...Review
author {
...User
}
}
}
}
`,
}),
})
.then(res => res.json())
.then(data => console.log(JSON.stringify(data, null, 2)));
Loading