Skip to content

Add how to resolve user properties to docs#1292

Merged
klausi merged 2 commits intodrupal-graphql:8.x-4.xfrom
Cryt1c:patch-1
Jul 13, 2022
Merged

Add how to resolve user properties to docs#1292
klausi merged 2 commits intodrupal-graphql:8.x-4.xfrom
Cryt1c:patch-1

Conversation

@Cryt1c
Copy link
Copy Markdown
Contributor

@Cryt1c Cryt1c commented Jun 24, 2022

There was a full working example requested here:
#1288

There was a full working example requested here:
drupal-graphql#1288
@joaogarin joaogarin requested a review from klausi July 8, 2022 06:00
Copy link
Copy Markdown
Contributor

@klausi klausi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some whitespace issues that should be cleaned up!

Comment thread doc/producers/custom.md
(For this to actually work we would need to add resolvers to the User object to resolve the `id` and `name` properties).
For this to actually work we would need to add resolvers to the User object to resolve the `id` and `name` properties like so:
```php
$registry->addFieldResolver('User', 'id', $builder->callback(function ($account) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for the indentation here? We don't have it in the field resolver examples further above.

@klausi
Copy link
Copy Markdown
Contributor

klausi commented Jul 13, 2022

I can merge this anyway and fix the whitespace in a follow-up.

@klausi klausi merged commit 81bcdad into drupal-graphql:8.x-4.x Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants