Purpose of "Allow Multiple" and other questions

The documentation tells a little about the “Allow Multiple” field option, but not what it’s good for. Any examples? I know it’s not searchable. Can you update a single value, or it’s always treated as a whole?

I did some experimentation:

mutation {
  foobarUpdate(filter: {
    id: "ck1s7iarq02ts01jy6qca4ow8"
  }, data: {
    multipleTest: ["one", "two"]
  }) {
    id
    multipleTest
  }
}

So I learned that GraphQL supports arrays. Can I ask how they are represented in the DB (in general, not implementation per se)?

I’m also interested to know the difference between JSON type field, and a text that you just convert with JSON.parse()? What is the character limit for JSON fields?

1 Like

Hey @mike_ekim1024!

Great question on what it’s useful for. I think a few of us have asked the same question at one time or another :rofl:

I saw it used once on a previous_usernames text field on a custom User’s table. I thought this was a good example of how it could be used, to store some almost arbitrary data that wouldn’t really be appropriately stored on another table.

Behind the scenes, they are being stored as JSON in the database: https://aws.amazon.com/blogs/database/using-json-with-mysql-5-7-compatible-amazon-aurora/

@evgeny.semushin comment better on how that works.

1 Like