Cannot generate grapqhl schema for Stripe API
See original GitHub issueDescribe the bug Not able to generate Graphql Schema with openapi-to-graphql cli using Stripe’s API OAS definition
To Reproduce Steps to reproduce the behavior:
- install the openapi-to-graphql-cli
- try generating schema by running:
openapi-to-graphql https://api.apis.guru/v2/specs/stripe.com/2019-03-14/swagger.json
Expected behavior The graphql server starts with generated Stripe API schema
Actual result Getting the following error:
openapi-to-graphql https://api.apis.guru/v2/specs/stripe.com/2019-03-14/swagger.json(node:54348) ExperimentalWarning: The http2 module is an experimental API.
OpenAPI-to-GraphQL creation event error: Cannot read property 'schema' of null
Additional context Up to date latest OAS Stripe’s spec can be grabbed here: https://github.com/stripe/openapi/blob/master/openapi/spec3.json *same generation result as described above
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:26 (10 by maintainers)
Top Results From Across the Web
Convert the Stripe API into a GraphQL Schema with ... - StepZen
In a new blank project, create a directory called schema and create two files inside that directory called balance.graphql and charge.graphql ...
Read more >Getting Stripe call to resolve in GraphQL schema
I am trying to create an API endpoint using GraphQL and stripe, however I can't get the data to resolve correctly with Stripe's...
Read more >Open Source Stripe GraphQL API - Nhost
The generated Stripe GraphQL API can be hosted using a Serverless Function and added as a Hasura Remote Schema. After that, a GraphQL...
Read more >Converting Stripes API to GraphQL - Table Dog
Converting Stripes HTTP API to GraphQL The tdog CLI continuously downloads from your Stripe account and writes to your Postgres database. ...
Read more >12. Create schema and resolver for creating a new Stripe ...
Learn # GraphQL, In One WeekBuild a fullstack eCommerce application with GraphQL Yoga, Prisma, Planetscale, Next.js, Tailwind CSS, & Stripe ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey everyone! I know this has been a very, very long awaited feature but it is finally out. We have support for
allOf
,anyOf
,oneOf
, andnot
as well as more robust fallback mechanisms and we can officially say that we can wrap the Stripe API in GraphQL with the release of OtG v2.0.0!In the screenshot, you can see that we are able to successfully run a query against the Stripe API.
Let me know what your experience is! Thanks for sticking around!
I found the problem. OAS uses a few keywords to combine schemas, namely “oneOf”, “anyOf”, “allOf”, and “not”. Currently OtG only supports “allOf”. Stripe makes use of (at least) “anyOf”.
These keywords throw a wrench in the GraphQL ecosystem. Because GraphQL enforces a strong typing system and combining schemas muddles the typing. Implementing “allOf” is easy to do, but “oneOf” and “anyOf” are tricky, and “not” may be impossible (we will probably resort to stringifying the data or use the GraphQL JSON type). For more information, see #14.
For the time being, I have improved reporting with #199.