-
-
Notifications
You must be signed in to change notification settings - Fork 882
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
fix(graphql): Embedded nullable relations graphql #6100
fix(graphql): Embedded nullable relations graphql #6100
Conversation
c3779ea
to
384b648
Compare
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.
Nice fix, would it be possible to check for a change in the behat features (add a test that checks the schema where a property isn't required)?
384b648
to
00f8d50
Compare
I've added a behat test for this, and while doing this I found an edge-case that wasn't taken care of. Namely, if you have 2 references to the same type, it will 'cache' the type definition (including the required/not required attribute). I had to throw a few things around in Next up I will refactor the required argument and double-check cs-fixer/phpstan. |
f2e3b95
to
d15faef
Compare
@soyuka I've addressed everything I believe. Not sure why the Please review the changes whenever you can. |
e70e4f6
to
0d95307
Compare
@soyuka Thanks for the review, i've addressed the deprecating of the |
0d95307
to
3055b7a
Compare
@soyuka Any chance you can re-review this? |
Lowest is green on 3.2 so I think this is related. You need to reproduce the steps of the CI, basically |
{ | ||
if ($typeBuilder instanceof TypeBuilderInterface) { | ||
@trigger_error(sprintf('$typeBuilder argument of FieldsBuilder implementing "%s" is deprecated since API Platform 3.1. It has to implement "%s" instead.', TypeBuilderInterface::class, TypeBuilderEnumInterface::class), \E_USER_DEPRECATED); | ||
} | ||
if ($typeBuilder instanceof TypeBuilderEnumInterface) { | ||
@trigger_error(sprintf('$typeBuilder argument of TypeConverter implementing "%s" is deprecated since API Platform 3.3. It has to implement "%s" instead.', TypeBuilderEnumInterface::class, ContextAwareTypeBuilderInterface::class), \E_USER_DEPRECATED); |
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.
Perfect, but this means that we need to target main
we wouldn't want to introduce deprecations in a patch release (3.3 will come out soon).
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.
Quite nice, few leftovers, I know the lowest
test that breaks isn't fun to fix I'm not sure why the schema changed only on the lowest branch.
3055b7a
to
c7d1769
Compare
c7d1769
to
469e300
Compare
469e300
to
7675366
Compare
@soyuka Thanks again. I've rebased&r my branch on Please check if all looks good now :) And again, your help is much appreciated. |
main
We have a number of cases where we support creating new entities through a relationship with a 'parent' entity. This works fine, but the prop is always marked as 'required' in the GraphQL types that are being generated. This PR addresses this issue and will look for
#[ApiProperty(required: false)]
or#[ORM\JoinColumn(nullable: true)]
to mark the input as non-required in the GraphQL type.