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

Hasura Console Permissions + Composite Keys | TypeError: Cannot read properties of null (reading 'schema') #10576

Open
nyoung697 opened this issue Oct 26, 2024 · 0 comments
Labels
c/console Related to console k/bug Something isn't working

Comments

@nyoung697
Copy link

nyoung697 commented Oct 26, 2024

Version Information

Server Version: v2.42.0 (tested on 2.40 as well)
CLI Version (for CLI related issue): v2.42.0

Environment

All

What is the current behaviour?

When using a composite foreign key, the permission builder throws an error: TypeError: Cannot read properties of null (reading 'schema')

For example, I have the tables: project, scene, resource, and scene_resource.

  • scene and resource both reference project with a FK.
  • scene_resource references all the tables.
  • On scene_resource I have composite FKs of:
    • ( project_id, resource_id ) → resource . ( project_id, id )
    • ( project_id, scene_id ) → scene . ( project_id, id ).
  • I also have a FK of project_id → project . id

After adding the Hasura relationships, in the permission builder for scene_resource, I can select project no problem, but if I select either scene or resource, the console throws the error.

Screenshot 2024-10-26 at 9 31 10 AM

What is the expected behaviour?

That it doesn't throw an error and I can build a permission through the console...

How to reproduce the issue?

https://github.com/nyoung697/hasura-bug

Screenshots or Screencast

Screen.Recording.2024-10-26.at.9.32.43.AM.mov

Please provide any traces or logs that could help here.

Screenshot 2024-10-26 at 9 37 10 AM Screenshot 2024-10-26 at 9 37 22 AM

Any possible solutions/workarounds you're aware of?

I am able to create the permissions by manually modifying the .yaml file directly, then calling hasura deploy

Keywords

hasura console, TypeError: Cannot read properties of null (reading 'schema'), composite keys

@nyoung697 nyoung697 added the k/bug Something isn't working label Oct 26, 2024
@soorajshankar soorajshankar added the c/console Related to console label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console Related to console k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants