-
-
Notifications
You must be signed in to change notification settings - Fork 844
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
[GraphQL] Custom types #2492
[GraphQL] Custom types #2492
Conversation
src/GraphQl/Type/SchemaBuilder.php
Outdated
$this->graphqlTypes['Iterable'] = new IterableType(); | ||
if ($this->typesFactory) { | ||
$this->graphqlTypes += $this->typesFactory->getTypes(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove this else
or add a deprecation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this is still marked as Experimental no? I'd just keep the l81.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was asking this because of @dunglas's comment: #2447 (comment)
2b88286
to
5dd0b91
Compare
@lukasluecke WDYT of this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
$tag['id'] = $serviceId; | ||
} | ||
|
||
$types[$tag['id']] = new Reference($serviceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the isset line 37-39
$types[$tag['id']] = new Reference($serviceId); | |
$types[$tag['id'] ?? $serviceId] = new Reference($serviceId); |
@soyuka do you think we could merge this one? |
Can't merge because of travis :| |
5dd0b91
to
bd186cf
Compare
bd186cf
to
7331f27
Compare
Thanks @alanpoulain ! |
Add a
TypeInterface
to register automatically custom types in GraphQL.The
IterableType
has been modified to be used this way.A
TypesFactory
service has been added, along with its interface to allow to register custom types any way you want.Should we add a deprecation (see my comment below)?