Different behaviour - @dontInfer vs dontInfer in extensions #33836
Unanswered
tonyhallett
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Skipping schema inference for a node is possible when createTypes
a) From a string - using the directive
@dontInfer
b) From a gatsby builder - dontInfer in extensions
When createTypes the inference-metadata reducer will set ignored to true for the dontInfer directive and for extensions dontInfer and infer = false
typesWithoutInference
When buildInferenceMetadata for types of nodes in the data store, if ignored no nodes are added and when addInferredTypes the type will be ignored as hasNodes returns false.
When gatsby processAddedType addExtensions is called which will convert the
@infer
/@dontInfer
directive to the infer extension.When addInferredTypes is called the runInfer condition does not consider the dontInfer extension.
The same can be said with getInferenceConfig
In both of these cases dontInfer in extensions will infer.
dontInfer in extensions is not mentioned in schema-customization docs.
But
and
So if it is indeed necessary to check in extensions then the two areas identified should be updated to consider dontInfer in extensions.
Beta Was this translation helpful? Give feedback.
All reactions