relay
relay copied to clipboard
Validate edgeTypeName argument points to an existing type
Currently you can input any string for the edgeTypeName
argument on the @prependNode
and @appendNode
directives.
This change enforces that the value you supply points to an existing object type within the schema.
So good! Thank you!
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Still working on landing this. It looks like it's triggering a number of errors internally. Trying to figure out if this is because we're catching real errors (and if so, how we can resolve them), or if there's something else going on here.
Is this still blocked internally?
Sorry, haven't been able to revisit. Adding to my todo list for next week.
So we have many infractions in our codebaese today, and I don't see an obvious way to "fix" these issues at scale. Maybe we need a mechanism to selectively ignore this warning for existing infractions? Perhaps we could leverage our feature flag infra here?
Also, would be cool to suggest types with similar names in this error, I think we have examples of that elsewhere in the codebase.
@captbaritone Added object type suggestions and a feature flag to disable the validation :)
@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@captbaritone I fixed the conflicts :)