Skip to content

How to define double nested array in schema #423

Closed
@takotuesday

Description

@takotuesday

I am trying to do the following:

// Schema definitions
const typeDefs = `
type Chart {
  name: String
  series: [Series]
}

type Series {
  name: String!
  data: [[Int, Float]]
}
`

where Series.data is an array of data points. Each data point is an array of x,y coordinates. For this use case a point cannot be an object with x,y keys, it must be an array. This fails to build because GraphQL does not like the definition of data: [[Int, Float]]. I have scoured the internet, GitHub, and stackoverflow. What is the solution/workaround for this? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions