Skip to content

[GraphQL Mutation] will treat @ORM\Embedded as String type #1750

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

Closed
leesiongchan opened this issue Mar 6, 2018 · 10 comments
Closed

[GraphQL Mutation] will treat @ORM\Embedded as String type #1750

leesiongchan opened this issue Mar 6, 2018 · 10 comments

Comments

@leesiongchan
Copy link
Contributor

No description provided.

@leesiongchan
Copy link
Contributor Author

Or graphql doesn't support nested mutation yet?

@leesiongchan leesiongchan changed the title GraphQL will treat @ORM\Embedded as String type [GraphQL Mutation] will treat @ORM\Embedded as String type Mar 7, 2018
@leesiongchan
Copy link
Contributor Author

ping @alanpoulain

@alanpoulain
Copy link
Member

alanpoulain commented Mar 7, 2018

Yes, API Platform doesn't support nested mutations (yet?). You need to give an IRI for a subresource. I will document it later. See also this PR: #1702 But for an embedded entity I'm not sure about which behaviour we want.

@leesiongchan
Copy link
Contributor Author

But for an embedded entity I'm not sure about which behaviour we want.

Do you mean whether to treat it as flat or object? In the meantime, what is the temporary solution to deal with embedded type?

@alanpoulain
Copy link
Member

Yes. I think it would be better to treat it like a json_array (iterable type, see this PR #1661). In the meantime have you tried to give it as a JSON encoded string?

@leesiongchan
Copy link
Contributor Author

Yes. I think it would be better to treat it like a json_array (iterable type, see this PR #1661).

Yes, indeed.

In the meantime have you tried to give it as a JSON encoded string?

Tested, it still throwing errors :(

@alanpoulain
Copy link
Member

What are the errors?

@leesiongchan
Copy link
Contributor Author

error

@alanpoulain
Copy link
Member

I think you are done for, sorry :( You have to wait for a fix.

@eradionov
Copy link

Embedded resource does not work for queries as well for graphql
Is it supported in api-platform?

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

No branches or pull requests

4 participants