-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
Various major fixes to schema exporting #2050
Conversation
🦋 Changeset detectedLatest commit: 2a00087 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…g it in place (fix enums)
… additional properties set, and makes sure these properties are exported too. (Typically this is `fn.isSyncAndSafe=true` for Grafast optimization.)
…d for input objects.
c180f80
to
420301b
Compare
…with enums and more.
…BLE) to fix schema exports.
…fer`/`@stream` directives are present.
@@ -12373,6 +12389,15 @@ const makeArgs64 = (args, path = []) => { | |||
return selectArgs; | |||
}; | |||
const resource_compound_type_computed_fieldPgResource = registry.pgResources["compound_type_computed_field"]; | |||
function UUIDSerialize(value) { | |||
return "" + value; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an optimization we should have this export as toString
(the source name) rather than being called UUIDSerialize
everywhere. But no big deal.
NestedCompoundTypeInput: { | ||
"__inputPlan": function NestedCompoundTypeInput_inputPlan() { | ||
return object(Object.create(null)); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to optimize this down to a method syntax.
Description
This PR sets up testing of the exported schemas by running the integration tests again, this time by generating the schema (as before) then exporting the schema, importing it, and using the imported version for running the tests. It's really inefficient right now, making the tests really slow, but worth it for peace of mind. In future this will need to be redeveloped to find all the schema configurations and then write out those schemas in advance and use them to run the tests against.
Then, of course, there were loads of hard to figure out errors/discrepancies which I had to track down. Roughly:
grafast
'smakeGrafastSchema
has been rebuilt to follow better patterns (fixing issues with enums in the process)grafast
'smakeGrafastSchema
now supports__inputPlan(){}
on an input object's plansgraphile-export
now exports the input object input plan intypeDefs
modegraphile-export
now detects functions with additional properties (e.g.isSyncAndSafe: true
) and makes sure these properties are represented in the exportgraphile-export
now outputs theserialize
,parseValue
andparseLiteral
methods on custom scalars intypeDefs
modeEXPORTABLE
to fix exportsEXPORTABLE
from a couple of things to fix exportsConstantStep
now supports.get()
and.at()
patternsenableDeferStream
detection in schema export by looking at directives in schema being exportedFixes #2043
Fixes #2049
Performance impact
Import/export only.
Security impact
Improvement: more accurate exports are safer.
Checklist
yarn lint:fix
passes.yarn test
passes.RELEASE_NOTES.md
file (if one exists).