-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate alternatives to json-schema-to-graphql-types #163
Comments
Here’s what I’ve learned:
MeshI found 2 possible paths for generating schemas given what we have from FOLIO. These involve 2 different “handlers”. Options can be configured in a
// package.json
"@graphql-mesh/cli": "^0.88.9",
"@graphql-mesh/json-schema": "^0.98.2", // .meshrc.yml
sources:
- name: APIs
handler:
jsonSchema:
operations:
- type: Query
field: item
responseSample: ./samples/callnumbertype.json
responseTypeName: Item
// package.json
"@graphql-mesh/cli": "^0.88.9",
"@graphql-mesh/postgraphile": "^0.96.6", // .meshrc.yml
sources:
- name: FolioDB
handler:
postgraphile:
connectionString: postgres://okapi:password@localhost:5432/okapi
schemaName: ["sul_mod_circulation_storage", "sul_mod_courses"]
appendPlugins:
- './my-plugin.js'
I got further with this approach than the one above. The cool thing here is that we could remove the existing setup of linking with the FOLIO Github repositories to pull the JSON schemas. This approach relies on the
To summarizeI recommend importing the lifeomic library locally for the simplest transition. If we are more ambitious we can try prototyping an approach using mesh and graphile that would simplify our process of generating the graphql schema, eliminating the complex process of importing json-schemas from git. |
We use lifeomic/json-schema-to-graphql-types to automagically convert from FOLIO's JSON schemas to graphql schemas. Unfortunately, it isn't compatible with Graphql 16, and a year later seems like it may never be.
Is there something new or better out there, or should we fork or pull the code into this repo?
The text was updated successfully, but these errors were encountered: