Skip to content

fix: correct runtime check for resolve strategies#987

Open
gzomer wants to merge 3 commits intographql-nexus:mainfrom
gzomer:fix/correct-runtime-check
Open

fix: correct runtime check for resolve strategies#987
gzomer wants to merge 3 commits intographql-nexus:mainfrom
gzomer:fix/correct-runtime-check

Conversation

@gzomer
Copy link

@gzomer gzomer commented Sep 8, 2021

The documentation states that when both centralized and modular strategies are enabled you have to either implement isTypeOf in all members or implement resolveType in the abstract type.

isTypeOf on all member types & resolveType on abstract type required until either all members have isTypeOf implemented or resolveType is implemented.

However, the current implementations is as follows:

if (
      (resolveTypeImplemented === false || typesWithoutIsTypeOf.length > 0) &&
      features.abstractTypeStrategies.isTypeOf === true &&
      features.abstractTypeStrategies.resolveType === true
    ) {

Instead, it should only trigger an error when both checks are false (no resolver implemented and there are missing types).

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

Successfully merging this pull request may close these issues.

4 participants