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-simple - typescript template + buildQuery question #6712

Closed
stefanburt opened this issue Oct 20, 2021 · 4 comments · Fixed by #6724
Closed

ra-data-graphql-simple - typescript template + buildQuery question #6712

stefanburt opened this issue Oct 20, 2021 · 4 comments · Fixed by #6724

Comments

@stefanburt
Copy link

stefanburt commented Oct 20, 2021

Hello React Admin,

I'm building a new project using RA and ra-data-graphql-simple and our codebase is built using typescript. I was wondering if the recently updated ra-data-graphql-simple supports TS?

I'm following https://github.com/marmelab/react-admin/tree/master/packages/ra-data-graphql-simple#usage but this is the non TS implementation I was wondering if there is documentation to support the recent update.

Many thanks for any assistance

Stefan

We primarily use GitHub as an issue tracker; for usage and support questions, please use StackOverflow(https://stackoverflow.com/questions/tagged/react-admin using the tag react-admin). Thanks! 😁.

@stefanburt
Copy link
Author

stefanburt commented Oct 21, 2021

In addition I've looked closer at the implementation it's the build query which is the source of my confusion.
It's set as a required property so when it gets converted to a type definition file.
https://github.com/marmelab/react-admin/blob/master/packages/ra-data-graphql-simple/src/index.ts#L7

My question is could this be made optional so I don't have to pass one in as the non TS version doesn't require one.

I guess from here either it could be optional or could more information be supplied as what form the buildQuery should contain as a default?

Many thanks

@stefanburt stefanburt changed the title ra-data-graphql-simple - typescript template? ra-data-graphql-simple - typescript template + buildQuery question Oct 21, 2021
@djhi
Copy link
Collaborator

djhi commented Oct 21, 2021

Hi and thanks for reporting this. The buildQuery function should indeed be optional in ra-data-graphql-simple. Can you make a PR?

@stefanburt
Copy link
Author

@djhi Thanks for the reply, sure thing I'll make the change and raise a pr 👍

@stefanburt
Copy link
Author

stefanburt commented Oct 21, 2021

@djhi - I've raised a PR for this issue - #6717
I made changes to the READ.ME as well to fix an issue with the example code but that's listed in the PR. Hope this is correct and if I've missed anything please feedback and I'll be happy to make changes or revert things outside of the scope of the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants