Git Product home page Git Product logo

ardatan / schema-stitching Goto Github PK

View Code? Open in Web Editor NEW
45.0 5.0 9.0 4.91 MB

Automatically stitch multiple schemas together into one larger API in a simple, fast and powerful way.

Home Page: https://the-guild.dev/graphql/stitching

License: MIT License

JavaScript 1.78% TypeScript 2.36% Shell 0.02% MDX 95.84%
gateway graphql federation microservices stitching schema-stitching type-merging schema-extensions

schema-stitching's Introduction

Schema Stitching

npm version

Documentation

https://the-guild.dev/graphql/stitching

Contributions

Contributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR!

And if this is your first time contributing to this project, please do read our Contributor Workflow Guide before you get started off.

Code of Conduct

Help us keep GraphQL ESLint open and inclusive. Please read and follow our Code of Conduct as adopted from Contributor Covenant.

License

Released under the MIT license.

schema-stitching's People

Contributors

ardatan avatar atoncetti avatar dependabot[bot] avatar dimamachina avatar dotansimha avatar gilgardosh avatar kenfdev avatar lomoval avatar mgriff23 avatar renovate[bot] avatar tdipadova3rd avatar tuvalsimha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

schema-stitching's Issues

Schema organization in the context of using Schema Stitching directives

hello, I use the "schema stitching" part with a gateway and to simplify maintenance and upgrades, I use "stitching directives" in the sub-services to make the links between them.
However, I was wondering if it would be possible to better organize the graph as a whole (all the queries are scattered throughout the documentation, which makes reading a bit complex).

Isn't it possible to use schemas like:

type typeA {
    id: ID!
    name: String!
  }
type Query {
 subServiceA: subServiceAQuery
}
type subServiceAQuery {
 "hello world"
 get(id: ID!): typeA @merge(keyField: "id")
}

I'm asking because I can't figure out how to do it, knowing that @merge can only be used as a root query field. How can I do this?

Incorrect bytes order (chunks) in uploaded file.

I have a problem with uploading files through the gateway.
Small files work fine. But if the file is split into chunks during transmission, then the resulting file has the wrong order of chunks.
This problem occurred when I was checking the Yoga server and stitching with my Go server (gqlgen).
Resulting zip files were broken.
I have recheck your example https://github.com/ardatan/schema-stitching/tree/master/examples/graphql-upload and got the same result.

Steps to reproduce:

  1. Create a file with content
1
2
3
4
5
...
10000
  1. Start services from here https://github.com/ardatan/schema-stitching/tree/master/examples/graphql-upload
  2. Upload file from step 1 to gateway with upload mutation mutation add($file: File!){ uploadFile(file:$file){ name } }

Expected behavior:
Uploaded(stored) file has same content as source file.

Actual behavior:
Content of uploaded(stored) file is different from source file. I have attached the source file and the saved file from my check as an example.
dif
Source: checkFile.txt
Uploaded: checkFile.txt

Additional info
OS Name: Microsoft Windows 10 Home Single Language
OS Version: 10.0.19045 N/A Build 19045
Node Version: v20.5.1
Yarn Version: 1.22.11

Combining local and remote schema example doesn't work

Cloning the repo, executing the start script, i get the following output:

[storefronts] [INFO] 10:18:08 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.3.2)
[products] [INFO] 10:18:08 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.3.2)
[gateway] [INFO] 10:18:08 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.3.2)
[products] products running at http://localhost:4001/graphql
[storefronts] storefronts  running at http://localhost:4001/graphql
[gateway] gateway running at http://localhost:4000/graphql
[gateway] TypeError: Cannot use 'in' operator to search for '_sdl' in null
[gateway]     at fetchRemoteSDL (/Users/marco/Documents/code/experimentation/schema-stitching/examples/combining-local-and-remote-schemas/src/gateway.ts:99:33)
[gateway]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[gateway]     at makeGatewaySchema (/Users/marco/Documents/code/experimentation/schema-stitching/examples/combining-local-and-remote-schemas/src/gateway.ts:47:29)
[gateway] [ERROR] 10:18:10 TypeError: Cannot use 'in' operator to search for '_sdl' in null

Ideally it would be great if the example works :)

History of the project / repo

Hi,

I noticed that the repo was created in early 2023 and none of the git history of the original codebase was imported. That means there is a lot of context lost around the git history and the previous issue tracker. Is there way to find that history? Without this, it looks a bit like the project is no longer maintained, since it's not very active.

Best!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bundler
examples/subservice-languages/ruby/Gemfile
  • graphql '~> 1.10'
  • graphql-schema_directives '~> 0.0'
  • rack '~> 2.0'
github-actions
.github/workflows/tests.yml
  • actions/checkout v4
  • actions/checkout v4
  • ruby/setup-ruby v1
  • actions/cache v4
.github/workflows/website.yml
  • actions/checkout v4
npm
examples/combining-local-and-remote-schemas/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/utils ^10.0.0
  • @graphql-tools/wrap ^10.0.0
  • @types/node ^20.0.0
  • @types/wait-on ^5.3.1
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.0
examples/computed-fields/package.json
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/wrap ^10.0.0
  • @types/node ^20.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/continuous-integration-testing/package.json
  • @graphql-tools/delegate ^10.0.0
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • @babel/core 7.24.5
  • @babel/plugin-proposal-class-properties 7.18.6
  • @babel/preset-env 7.24.5
  • @babel/preset-typescript 7.24.1
  • @graphql-tools/mock ^9.0.0
  • @graphql-tools/utils ^10.0.0
  • @types/jest ^29.2.6
  • @types/node ^20.0.0
  • jest ^29.0.0
  • typescript 5.4.5
examples/custom-merge-resolvers/package.json
  • @graphql-tools/batch-delegate ^9.0.0
  • @graphql-tools/delegate ^10.0.0
  • @graphql-tools/stitch ^9.0.0
  • @types/node ^20.0.0
  • dataloader ^2.1.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/federation-supergraph/package.json
  • @apollo/subgraph ^2.2.3
  • @graphql-tools/federation ^1.1.3
  • @types/node ^20.0.0
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/federation-to-stitching-sdl/package.json
  • @apollo/subgraph ^2.2.3
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • @types/node ^20.0.0
  • @types/wait-on ^5.3.1
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.1
examples/graphql-upload/package.json
  • @graphql-tools/delegate ^10.0.0
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/wrap ^10.0.0
  • @types/mime-types ^2.1.1
  • @types/node ^20.0.0
  • @types/sharp ^0.32.0
  • @types/wait-on ^5.3.1
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • mime-types ^2.1.35
  • sharp ^0.33.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.0
examples/hot-schema-reloading/package.json
  • @graphql-tools/delegate ^10.0.0
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • @types/node ^20.0.0
  • @types/wait-on ^5.3.1
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.0
examples/mutations-and-subscriptions/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/wrap ^10.0.0
  • @types/node ^20.0.0
  • @types/wait-on ^5.3.1
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.0
examples/persistent-connection/package.json
  • @graphql-tools/executor-graphql-ws ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • @types/ws ^8.5.4
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-ws ^5.11.2
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • ws ^8.12.0
examples/public-and-private-apis/package.json
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/stitching-directives-sdl/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.1
examples/subservice-languages/javascript/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • @types/node ^20.0.0
  • class-validator ^0.14.0
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-scalars ^1.22.2
  • graphql-yoga ^5.0.0
  • nexus ^1.0.0
  • nodemon ^3.0.0
  • reflect-metadata ^0.2.0
  • ts-node ^10.9.1
  • type-graphql ^2.0.0-beta.1
  • typescript ^5.0.0
  • wait-on ^7.0.1
examples/subservice-languages/ruby/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • @types/node ^20.0.0
  • @types/wait-on ^5.3.1
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.1
  • kill-port-process 3.2.1
examples/type-merging-arrays/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/wrap ^10.0.0
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.1
examples/type-merging-interfaces/package.json
  • @graphql-tools/stitch ^9.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/type-merging-multiple-keys/package.json
  • @graphql-tools/stitch ^9.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/type-merging-nullables/package.json
  • @graphql-tools/stitch ^9.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
examples/type-merging-single-records/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/wrap ^10.0.0
  • concurrently ^8.0.0
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
  • wait-on ^7.0.1
examples/versioning-schema-releases/package.json
  • @graphql-tools/executor-http ^1.0.0
  • @graphql-tools/stitch ^9.0.0
  • @graphql-tools/stitching-directives ^3.0.0
  • @graphql-tools/utils ^10.0.0
  • @whatwg-node/fetch ^0.9.0
  • concurrently ^8.0.0
  • cross-env ^7.0.3
  • graphql ^16.6.0
  • graphql-yoga ^5.0.0
  • ts-node ^10.9.1
  • ts-node-dev ^2.0.0
  • typescript ^5.0.0
package.json
  • @babel/core 7.24.5
  • @babel/plugin-proposal-class-properties 7.18.6
  • @babel/plugin-proposal-decorators 7.24.1
  • @babel/preset-env 7.24.5
  • @babel/preset-typescript 7.24.1
  • @theguild/prettier-config 2.0.6
  • @types/jest 29.5.12
  • @typescript-eslint/eslint-plugin 7.8.0
  • @typescript-eslint/parser 7.8.0
  • array.prototype.flatmap 1.3.2
  • babel-jest 29.7.0
  • babel-plugin-parameter-decorator 1.0.16
  • babel-plugin-transform-typescript-metadata 0.3.2
  • eslint 9.2.0
  • eslint-config-prettier 9.1.0
  • eslint-config-standard 17.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-n 17.5.1
  • eslint-plugin-promise 6.1.1
  • eslint-plugin-standard 5.0.0
  • husky 9.0.11
  • jest 29.7.0
  • lint-staged 15.2.2
  • prettier 3.2.5
  • typescript 5.4.5
  • esbuild ^0.21.0
  • graphql 16.8.1
website/package.json
  • @theguild/components ^6.5.3
  • next ^14.1.4
  • next-sitemap ^4.2.3
  • react ^18.2.0
  • react-dom ^18.2.0
  • react-icons ^5.0.0
  • @theguild/tailwind-config 0.4.1
  • @types/node 20.12.10
  • @types/react 18.3.1
  • typescript 5.4.5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.