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

fix(schema): don't create empty resolver objects #2073

Conversation

craicoverflow
Copy link

@craicoverflow craicoverflow commented Sep 18, 2020

Fixes #2070

Verification

  1. Disable all subscriptions, either globally through buildGraphbackAPI or per model in the @model annotation.
    Start the server - it should work. Debug the resolvers object created by Graphback, there should be no Subscription resolver object.

@craicoverflow craicoverflow requested review from machi1990 and wtrocki Sep 18, 2020
}
if (model.crudOptions.delete && model.crudOptions.subDelete) {
this.addDeleteSubscriptionResolver(modelType, subscriptionObj)
const createSubEnabled = model.crudOptions.create && model.crudOptions.subCreate;
Copy link
Member

@wtrocki wtrocki Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to remove model.crudOptions.create from check. This is use case we going to have - we want to have just subscriptions enabled for the object but no create.

Good timing

Copy link
Author

@craicoverflow craicoverflow Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

Copy link
Contributor

@machi1990 machi1990 left a comment

There are CI failures which seem to be related to the comments / suggestions inline.

https://github.com/aerogear/graphback/pull/2073/checks?check_run_id=1133210899

@craicoverflow craicoverflow force-pushed the fix/subscriptions-defined-in-resolvers-not-in-schema branch from 0565887 to 2018f35 Compare Sep 18, 2020
@craicoverflow craicoverflow requested a review from machi1990 Sep 18, 2020
Copy link
Contributor

@machi1990 machi1990 left a comment

Comments addressed! Thank you for the quick fix.

@evanshortiss would love this :-)

@craicoverflow craicoverflow merged commit 86a9078 into aerogear:master Sep 18, 2020
@craicoverflow craicoverflow deleted the fix/subscriptions-defined-in-resolvers-not-in-schema branch Sep 18, 2020
@craicoverflow craicoverflow added the bug Something isn't working label Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Error: 'Subscription' defined in resolvers, but not in schema" when subscriptions are disabled
3 participants