Skip to content

Commit

Permalink
Add comments describing reasoning for query field name aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
cephalization committed Nov 25, 2024
1 parent 3d93dab commit 3a2a07f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/pages/playground/InvocationParametersFormFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ export const InvocationParametersFormFields = ({
required
canonicalName
}
# defaultValue must be aliased because Relay will not create a union type for fields with the same name
# follow the naming convention of the field type e.g. floatDefaultValue for FloatInvocationParameter
# default value mapping elsewhere in playground code relies on this naming convention
# https://github.com/facebook/relay/issues/3776
... on BoundedFloatInvocationParameter {
minValue
maxValue
Expand Down
4 changes: 4 additions & 0 deletions app/src/pages/playground/ModelSupportedParamsFetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export const ModelSupportedParamsFetcher = ({
canonicalName
required
}
# defaultValue must be aliased because Relay will not create a union type for fields with the same name
# follow the naming convention of the field type e.g. floatDefaultValue for FloatInvocationParameter
# default value mapping elsewhere in playground code relies on this naming convention
# https://github.com/facebook/relay/issues/3776
... on BooleanInvocationParameter {
booleanDefaultValue: defaultValue
invocationInputField
Expand Down

0 comments on commit 3a2a07f

Please sign in to comment.