-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add interceptors for auto-resolvers #6270
Conversation
89909ac
to
aa7e6ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
- Added
FieldMetadataGraphqlApiExceptionInterceptor
in/packages/twenty-server/src/engine/metadata-modules/field-metadata/field-metadata.module.ts
- Introduced
/packages/twenty-server/src/engine/metadata-modules/field-metadata/interceptors/field-metadata-graphql-api-exception.interceptor.ts
- Added
ObjectMetadataGraphqlApiExceptionInterceptor
in/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.module.ts
- Introduced
/packages/twenty-server/src/engine/metadata-modules/object-metadata/interceptors/object-metadata-graphql-api-exception.interceptor.ts
- Added
RelationMetadataGraphqlApiExceptionInterceptor
in/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.module.ts
- Introduced
/packages/twenty-server/src/engine/metadata-modules/relation-metadata/interceptors/relation-metadata-graphql-api-exception.interceptor.ts
6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
- Added
FieldMetadataGraphqlApiExceptionInterceptor
in/packages/twenty-server/src/engine/metadata-modules/field-metadata/field-metadata.module.ts
- Introduced
/packages/twenty-server/src/engine/metadata-modules/field-metadata/interceptors/field-metadata-graphql-api-exception.interceptor.ts
- Added
ObjectMetadataGraphqlApiExceptionInterceptor
in/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.module.ts
- Introduced
/packages/twenty-server/src/engine/metadata-modules/object-metadata/interceptors/object-metadata-graphql-api-exception.interceptor.ts
- Added
RelationMetadataGraphqlApiExceptionInterceptor
in/packages/twenty-server/src/engine/metadata-modules/relation-metadata/relation-metadata.module.ts
6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this couldn't be made generic but as you said it's not meant to stay so LGTM!
@Weiko not sure I will keep this or not. But I spent 2 hours yesterday to make it work with auto-resolvers and I could not. So I prefer work on it once we deprecate nestjs query |
Services exceptions are not catch when the endpoint comes from an auto-resolver.
We want to remove auto-resolver but it requires to implement pagination by ourselves.
As a quick fix, here are interceptors that will trigger the exception handler.
I had a hard time making it generic so I finally added one interceptor for each since this is not supposed to stay