relay icon indicating copy to clipboard operation
relay copied to clipboard

Validate edgeTypeName argument points to an existing type

Open tobias-tengler opened this issue 4 months ago • 9 comments

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.

tobias-tengler avatar Feb 20 '24 19:02 tobias-tengler

So good! Thank you!

captbaritone avatar Feb 26 '24 18:02 captbaritone

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Feb 26 '24 18:02 facebook-github-bot

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.

captbaritone avatar Mar 04 '24 21:03 captbaritone

Is this still blocked internally?

tobias-tengler avatar Apr 05 '24 08:04 tobias-tengler

Sorry, haven't been able to revisit. Adding to my todo list for next week.

captbaritone avatar Apr 05 '24 21:04 captbaritone

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 avatar Apr 08 '24 16:04 captbaritone

@captbaritone Added object type suggestions and a feature flag to disable the validation :)

tobias-tengler avatar Apr 08 '24 17:04 tobias-tengler

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 08 '24 20:05 facebook-github-bot

@captbaritone I fixed the conflicts :)

tobias-tengler avatar May 09 '24 09:05 tobias-tengler