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
So in my use case I have the following schema (simplified to the relevant bits):
type Mutation {
signUp(company: CompanyInput, family: FamilyInput): SignupResult
}
type CompanyInput {
type: OrganizationType
}
type FamilyInput {
type: OrganizationType
}
enum OrganizationType {
COMPANY
FAMILY
}
So my goal is to auto-populate the organizationType based on whether it belongs within CompanyInput or FamilyInput. So that's where getDefaultScalarArgValue comes in.
getDefaultScalarArgValue(parentField, arg, argType) {
/* LOGIC GOES HERE */
}
However, as it executes, when I select the organizationType within CompanyInput which invokes getDefaultScalarArgValue, parentField shows as signUp, arg is organizationType, and argType is OrganizationType. The problem is that you don't know who the immediate parent arg type is (which should be CompanyInput).
My thought is that within this part of AbstractArgView class, we need to pass in a parentArg prop.
So in my use case I have the following schema (simplified to the relevant bits):
So my goal is to auto-populate the
organizationType
based on whether it belongs withinCompanyInput
orFamilyInput
. So that's wheregetDefaultScalarArgValue
comes in.However, as it executes, when I select the
organizationType
within CompanyInput which invokesgetDefaultScalarArgValue
,parentField
shows assignUp
,arg
isorganizationType
, andargType
isOrganizationType
. The problem is that you don't know who the immediate parent arg type is (which should be CompanyInput).My thought is that within this part of
AbstractArgView
class, we need to pass in aparentArg
prop.graphiql-explorer/src/Explorer.js
Lines 790 to 812 in 69da97c
And this propagate that to
getDefaultScalarArgValue
, which would change its signature however:I'm wary of making signature changes. But when I pass in the parentArg, I can see that the
organizationType
belongs toCompanyInput
orFamilyInput
.The text was updated successfully, but these errors were encountered: