You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 9, 2023. It is now read-only.
Is your feature request related to a problem? Please describe.
Yes. When constructing FieldPaths with arguments, any extra arguments (i.e.: arguments which don't exist in the subgraph schema) are silently ignored, leading to harder debugging in case of errors like typos.
Moreover, although the values of real arguments are type-checked, the exceptions are cryptic and uninformative.
Describe the solution you'd like
When constructing FieldPaths with arguments, for each argument, Subgrounds should check whether:
The argument exists in the schema
The type of the argument's value matches the type indicated in the schema
If using relative FieldPaths (e.g.: subgraph.Query.entities(orderBy=subgraph.Entity.field)), validate that the field type on which that argument is applied matches the type of the relative FieldPath (i.e.: the type of entities matches the Entity object).
Error messages should also be clear and informative. E.g.: "X is not a valid value for argument orderBy".
Describe alternatives you've considered
None
Additional context
None
Implementation checklist
Validate arguments
Check whether the argument exists in the schema
Check whether the value given to the argument matches the type specified in the schema
Check whether relative FieldPaths match the type of the field
Improved error messages
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Yes. When constructing
FieldPaths
with arguments, any extra arguments (i.e.: arguments which don't exist in the subgraph schema) are silently ignored, leading to harder debugging in case of errors like typos.Moreover, although the values of real arguments are type-checked, the exceptions are cryptic and uninformative.
Describe the solution you'd like
When constructing
FieldPaths
with arguments, for each argument, Subgrounds should check whether:FieldPaths
(e.g.:subgraph.Query.entities(orderBy=subgraph.Entity.field)
), validate that the field type on which that argument is applied matches the type of the relativeFieldPath
(i.e.: the type ofentities
matches theEntity
object).Error messages should also be clear and informative. E.g.: "X is not a valid value for argument orderBy".
Describe alternatives you've considered
None
Additional context
None
Implementation checklist
FieldPaths
match the type of the fieldThe text was updated successfully, but these errors were encountered: