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

Support for Hasura 2.0 metadata? #250

Closed
supaspoida opened this issue Apr 29, 2021 · 9 comments
Closed

Support for Hasura 2.0 metadata? #250

supaspoida opened this issue Apr 29, 2021 · 9 comments

Comments

@supaspoida
Copy link

I've been experimenting with the hasura integration from this repo on a hasura 1.3 project. I'm looking to upgrade to hasura 2.0 which I know makes some changes to the metadata structure. I'm wondering if the automatic event registration from this package is expected to work with the new metadata format or if an update will be required?

Thank you!

@WonderPanda
Copy link
Collaborator

Hey @supaspoida I've also been watching the Hasura 2.0 progress with anticipation. I'm very excited by some of the changes happening over there and will most likely adopt it as soon as they drop the alpha tag and least move to beta.

The current Hasura Integration offered in this repo does still expect that tables.yaml will be a single file so if you're moving to the new metadata format that splits them out across multiple files I don't think it will work for you right now. I'll probably look at updating this once beta drops

@WonderPanda
Copy link
Collaborator

@supaspoida Now that the beta tag has been released I'm going to start work on this

@supaspoida
Copy link
Author

@WonderPanda that is awesome news, thanks for the update! Have been holding off on updating our metadata cause your lib is so helpful I didn't wanna give it up.

@WonderPanda
Copy link
Collaborator

@supaspoida Thanks 🙏

I'm curious to know more about your experience working with NestJS + Hasura are there any other painpoints or gaps that you wish were addressed?

I've been experimenting with the ability to generate permissions in TS using codegen which could then be applied against the Hasura metadata instead of having to configure all the permissions through the UI console. We've found that there's a ton of repetition and boilerplate around permissions so its an area I'd like to improve

@BraunreutherA
Copy link

Hi @WonderPanda,

I've created a PR #280 which handles the new Metadata Schema of Hasura 2.0 . I'll work on the cron hooks next. Maybe you could help by reviewing the code? :)

@WonderPanda
Copy link
Collaborator

Hey @BraunreutherA Just going through the PR, thank you for your contributions! I actually have support for the new metadata format built out on a local branch as well. The main difference is that I've included a config option in the Module so that consumers can indicate whether or not they want to target v2 or v3 metadata which means that it shouldn't be a breaking change for users who may still be on 1.x

I'll have some more time this evening to go through in depth and take a look at whether I can merge your work with the in progress stuff that I have

@BraunreutherA
Copy link

Hi @WonderPanda did you do some progress on this? If you can push your local branch to github, I could also help on merging it. We're very much looking for the v2 version :)

WonderPanda added a commit that referenced this issue Jul 1, 2021
@WonderPanda
Copy link
Collaborator

@BraunreutherA I'm planning on doing a release this evening. I've tagged you in the Pull Request #284 if you'd like to have a look. I took inspiration from the fixtures approach to testing you had stubbed out in your PR

WonderPanda added a commit that referenced this issue Jul 1, 2021
WonderPanda added a commit that referenced this issue Jul 5, 2021
@WonderPanda
Copy link
Collaborator

This is now available as of @golevelup/nestjs-hasura@1.3.0

If you would like to use v3 metadata you will need to pass v3 to the metadataVersion property of managedMetaDataConfig in your Module configuration.

I have some other breaking changes that I'd like to make to the Module Config in the near future so at that time I will update the default to be v3 and release a 2.x version of this package.

Please let me know if you run into any issues using this in your projects

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

No branches or pull requests

3 participants