Skip to content
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

ra-data-graphql: Update include/exclude introspection logic #5305

Merged

Conversation

Kilometers42
Copy link
Contributor

See #4933 for background info. But, right now all resources in the GQL data provider must implement both a GET_ONE and a GET_LIST for a resource to actually be considered a resource. This is very limiting because there is no workaround for a resource that only has a GET_ONE.

What this PR does is move the include/exclude logic to before the check that a resource has a GET_ONE and GET_LIST. If a resource is included or excluded, it will short circuit and either include or exclude the resource, regardless of the GET_ONE/GET_LIST check.

This solution is pretty solid in my opinion -- it is totally backward compatible, it allows users who want to include a resource that is a bit nonstandard to do so by explicitly setting a configuration object, and it feels more intuitive that a resource which is explicitly included in the configuration object is always included.

@fzaninotto fzaninotto merged commit b8b7fcd into marmelab:next Oct 1, 2020
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 3.9.0 milestone Oct 1, 2020
@Kilometers42 Kilometers42 deleted the gql-data-include-introspection branch October 1, 2020 15:14
@fzaninotto fzaninotto modified the milestones: 3.9.0, 3.9.2 Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants