graphql-binding / graphql-binding-github

Embed GitHub's GraphQL API into your server application
69 stars 10 forks source link

[Docs] example showing integration with `prisma` #75

Closed peterschussheim closed 4 years ago

peterschussheim commented 6 years ago

Problem

I've spent quite a bit of time trying to get this binding integrated into the prisma node-advanced template with zero success.

I am most definitely using the package wrong, however, I think if we had a realistic example demonstrating proper use, others and myself included would have an easier time using this binding (and bindings in general).

/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/language/parser.js:152
  throw unexpected(lexer);
  ^
GraphQLError: Syntax Error: Unexpected Name "GitObject"
    at syntaxError (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/error/syntaxError.js:24:10)
    at unexpected (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/language/parser.js:1322:33)
    at parseDefinition (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/language/parser.js:152:9)
    at parseDocument (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/language/parser.js:110:22)
    at parse (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/language/parser.js:38:10)
    at Object.buildSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql/utilities/buildASTSchema.js:461:43)
    at Object.makeRemoteExecutableSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/node_modules/graphql-tools/dist/stitching/makeRemoteExecutableSchema.js:54:28)
    at new GitHub (/Users/peter/Sources/Repos/notes/packages/notes-prisma/node_modules/graphql-binding-github/dist/index.js:27:38)
    at Object.<anonymous> (/Users/peter/Sources/Repos/notes/packages/notes-prisma/src/resolvers/Query.js:10:16)
    at Module._compile (module.js:635:30)
[nodemon] app crashed - waiting for file changes before starting...

Thank you

schickling commented 6 years ago

Great point @peterschussheim! We should definitely extend the example folder to examples and add one more "extensive" example.

Urigo commented 4 years ago

Thank you for reporting.

In the last few months, since the transition of many libraries under The Guild's leadership, We've reviewed and released many improvements and versions to graphql-cli, graphql-config and graphql-import.

We've reviewed graphql-binding, had many meetings with current users and engaged the community also through the roadmap issue.

What we've found is that the new GraphQL Mesh library is covering not only all the current capabilities of GraphQL Binding, but also the future ideas that were introduced in the original GraphQL Binding blog post and haven't come to life yet.

And the best thing - GraphQL Mesh gives you all those capabilities, even if your source is not a GraphQL service at all!
it can be GraphQL, OpenAPI/Swagger, gRPC, SQL or any other source! And of course you can even merge all those sources into a single SDK.

Just like GraphQL Binding, you get a fully typed SDK (thanks to the protocols SDKs and the GraphQL Code Generator), but from any source, and that SDK can run anywhere, as a connector or as a full blown gateway. And you can share your own "Mesh Modules" (which you would probably call "your own binding") and our community already created many of those! Also, we decided to simply expose regular GraphQL, so you can choose how to consume it using all the awesome fluent client SDKs out there.

If you think that we've missed anything from GraphQL Binding that is not supported in a better way in GraphQL Mesh, please let us know!