pristas-peter / wp-graphql-gutenberg

Query gutenberg blocks with wp-graphql
https://wp-graphql-gutenberg.netlify.app
GNU General Public License v3.0
299 stars 61 forks source link

Create a union type for types defined as array #141

Closed rodrigo-arias closed 20 hours ago

rodrigo-arias commented 2 years ago

@pristas-peter for the templateLock attribute the type is declared as an array instead of a string. This code creates a union and avoids the warning.

Closes #127

CleanShot 2022-03-21 at 16 08 14

CleanShot 2022-03-21 at 16 06 09

Let me know if it makes sense to you. I tried to follow the code standard of the file although it does not match WordPress-Core. Thanks

rodrigo-arias commented 2 years ago

Nevermind, seems that GraphQL doesn't support union on scalar types. Maybe you can give me an idea how to solve this

pressoholics commented 1 year ago

Hi @pristas-peter We have confirmed that this fix works for us.

Related to this issue: https://github.com/pristas-peter/wp-graphql-gutenberg/issues/158