The main aim of the PR is to allow developers to more easily extend/customise the GraphQL query fields sent from their React Admin app to Hasura backend.
This change introduces additional arguments to this library's default export - the buildDataProvider function - if these arguments are not provided then all defaults are used.
Because I ran prettier over the entire project, it looks as though lots of files have changed, but actually only a few have. Review the first 3 commits along with the final commit to see that actual changes that have been made.
Description
The main aim of the PR is to allow developers to more easily extend/customise the GraphQL query fields sent from their React Admin app to Hasura backend.
Why?
Currently it is very difficult to extend/customise queries - the fields must be defined with
graphql-ast-types-browser
syntax (very verbose) and the developer has to import many functions from this package: https://github.com/Steams/ra-data-hasura-graphql#example-query-related-entitiesHow does this PR make it easier to extend/customise queries?
gql
template literalsThis should resolve the following issues: https://github.com/Steams/ra-data-hasura-graphql/issues/38, https://github.com/Steams/ra-data-hasura-graphql/issues/66, https://github.com/Steams/ra-data-hasura-graphql/issues/29
Is it backwards compatible?
Yes.
This change introduces additional arguments to this library's default export - the
buildDataProvider
function - if these arguments are not provided then all defaults are used.For developers that are already providing a
buildQuery
override following https://github.com/Steams/ra-data-hasura-graphql#example-query-related-entities then their overrides will remain unchanged. This is possible because of24b4a96
(#68)How to review this PR
Because I ran
prettier
over the entire project, it looks as though lots of files have changed, but actually only a few have. Review the first 3 commits along with the final commit to see that actual changes that have been made.8b14196
(#68)aa015ed
(#68)2657081
(#68)a98fb7f
(#68) (README update)Proving this approach