Skip to content
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

Ruru incorrectly templates array values as singular #1891

Open
smoores-dev opened this issue Dec 13, 2023 · 1 comment
Open

Ruru incorrectly templates array values as singular #1891

smoores-dev opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@smoores-dev
Copy link
Contributor

Summary

In Ruru, if a mutation takes an input with an array field, the mutation input will be templated as a singular value instead.

Here's an example, to illustrate:

image

In the above schema, the propertyDefinitions field of the CreateAspectTypeInputRecordInput type (phew, that's a mouthful) is an array type:

image

But when using the Explorer panel to build a mutation, the actual mutation that Ruru templates out provides a single object value for propertyDefinitions, rather than an array of objects. This is true even for primitive values; fields that should be arrays of strings are templated as strings instead.

Steps to reproduce

  • Create a schema with a mutation whose input type has at least one array field
  • Open Ruru and start a mutation in the Explorer panel
  • Select your mutation type

Expected results

The code panel should contain a mutation with an array for the array field of the input

Actual results

The code panel contains a mutation with singular value for the array field of the input

Additional context

N/A

Possible Solution

N/A

@benjie
Copy link
Member

benjie commented Dec 14, 2023

This is actually a bug in https://www.npmjs.com/package/@graphiql/plugin-explorer and there's the same issue with the auto-complete: graphql/graphiql#587

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

No branches or pull requests

2 participants