Skip to content
New issue

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

Adding a field with args to an EntityRefObjectType #40

Open
rhermelingcoolblue opened this issue Apr 24, 2024 · 0 comments
Open

Adding a field with args to an EntityRefObjectType #40

rhermelingcoolblue opened this issue Apr 24, 2024 · 0 comments

Comments

@rhermelingcoolblue
Copy link

Hi I have a product entity

new EntityRefObjectType([
                'name' => 'Product',
                'keyFields' => ['id'],
                'fields' => [
                    'id' => fn() => [
                        'description' => 'The ID of the Product.',
                        'type' => Type::nonNull(Type::int()),
                    ],
                    'accessorySlot' => fn() => [
                        'description' =>
                            'Accessory alternatives that share a product type and or fiter set and or classification',
                        'type' => $this->createConfiguratorSlotType(),
                        'resolve' => $this->productAccessorySlotResolver,
                        'args' => [ 'criteria' => [
            'name' => 'AccessorySlotCriteria',
            'description' => 'The criteria an accessory slot should satisfy.',
            'keyFields' => ['productTypeId limit classificationId filterSetId'],
            'fields' => [
                'productTypeId' => fn() => [
                    'description' => "The accessory's product type.",
                    'type' => Type::nonNull(Type::int()),
                ],
            ],
        ] ]
                    ]
                ]
            ]);

And I this field (accessorySlot) Im contributing requires extra args namely productTypeId to be resolved. I used this configuration, but it seems that the args from the accessorySlot property are not picked up in the GraphQL schema
image

Is this intended behavior or is it simply not build yet? If the latter can you point me in the right direction to contribute this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant