Draft: Update Resolvers type to support Scalar
Description
Fixes missing type definition (GraphQLScalarType) for Resolvers in makeExtendSchemaPlugin.ts
Discord
Performance impact
unknown
Security impact
unkown
Checklist
- [x] My code matches the project's code style and
yarn lint:fixpasses. - [ ] I've added tests for the new feature, and
yarn testpasses. - [ ] I have detailed the new feature in the relevant documentation.
- [ ] I have added this feature to 'Pending' in the
RELEASE_NOTES.mdfile (if one exists). - [x] If this is a breaking change I've explained why.
Thanks for your contribution! To merge this as an officially supported interface we need a test that ensures it works. Doing so isn't too complex:
- Create yourself a plugin using this functionality; here's an example
ToyCategoriesPluginwe use in the tests: https://github.com/graphile/graphile-engine/blob/v4/packages/postgraphile-core/tests/integration/ToyCategoriesPlugin.js - Add a config boolean that enables your plugin; here's the one we use with
ToyCategoriesPlugin: https://github.com/graphile/graphile-engine/blob/5a146e2f8f4b17fc64a97bcc7e869337c8198457/packages/postgraphile-core/tests/helpers-v5.js#L472 - Add a test GraphQL file that uses this functionality, it must end in
.test.graphqland it must contain the special#> MyPluginNameHere: trueconfig line; here's an example for theToyCategoriesPlugin: https://github.com/graphile/graphile-engine/blob/06dddf87125a7c0b7ff24417aed75c9517216761/packages/postgraphile-core/tests/queries/base/named_query_builder.toys.test.graphql#L4 - Be sure that your GraphQL test file actually queries your scalar!
Once that's done, run the tests via UPDATE_SNAPSHOTS=1 yarn test inside the packages/postgraphile-core folder and your GraphQL query will be executed and the relevant snapshots will be created - check that they're sensible, and if so, go ahead and commit them.
Going to close this for now; feel free to re-open it with a test :heart:
Supported in V5: https://github.com/graphile/crystal/pull/1760