We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parseValue
input-object
Let's say I have the following Input object:
HeroInput: type: input-object config: fields: firstname: type: "String!" lastname: type: "String!"
and a resolver using this as an input:
Query: type: object config: fields: heroes: type: "Hero" args: name: type: "HeroInput!" resolve: "@=query('heroes', args['name'])"
The resolver method in PHP gets the name input as an array containing firstname and lastname keys.
name
firstname
lastname
public function heroes(array $name) { var_dump($name['firstname'], $name['lastname']);
I would like to have the input object as a real object in my resolver:
public function heroes(HeroInput $name) {
Documentation of webonyx/graphql-php mentions parseValue configuration: https://webonyx.github.io/graphql-php/type-definitions/inputs/#converting-input-object-array-to-value-object that could be used for this conversion.
webonyx/graphql-php
However, when I try to use parseValue for input-object:
HeroInput: type: input-object config: fields: firstname: type: "String!" lastname: type: "String!" parseValue: ['HeroInput', 'parseValue']
type I get error:
PHP Fatal error: Uncaught Symfony\Component\Config\Definition\Exception\InvalidConfigurationException: Unrecognized option "parseValue" under "overblog_graphql_types.HeroInput._input_object_config". Available options are "description", "fields", "name", "validation".
So it seems that the parseValue from webonyx/graphql-php is not exposed by overblog/graphql-bundle for input-object. Note: The custom-scalar type supports the parseValue configuration: https://github.com/overblog/GraphQLBundle/blob/master/docs/definitions/type-system/scalars.md#with-yaml .
overblog/graphql-bundle
custom-scalar
It would be nice to have the option available so that resolver method could get directly the PHP object instead of a plain array.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Let's say I have the following Input object:
and a resolver using this as an input:
The resolver method in PHP gets the
name
input as an array containingfirstname
andlastname
keys.I would like to have the input object as a real object in my resolver:
Documentation of
webonyx/graphql-php
mentionsparseValue
configuration: https://webonyx.github.io/graphql-php/type-definitions/inputs/#converting-input-object-array-to-value-object that could be used for this conversion.However, when I try to use
parseValue
forinput-object
:type I get error:
So it seems that the
parseValue
fromwebonyx/graphql-php
is not exposed byoverblog/graphql-bundle
forinput-object
.Note: The
custom-scalar
type supports theparseValue
configuration: https://github.com/overblog/GraphQLBundle/blob/master/docs/definitions/type-system/scalars.md#with-yaml .It would be nice to have the option available so that resolver method could get directly the PHP object instead of a plain array.
The text was updated successfully, but these errors were encountered: