VulcanJS / Vulcan

🌋 A toolkit to quickly build apps with React, GraphQL & Meteor
http://vulcanjs.org
MIT License
7.98k stars 1.88k forks source link

Schema files allow for numbers as keys. #2436

Open Salamit opened 4 years ago

Salamit commented 4 years ago

In response to @eric-burel asking me to open an issue, schema files allow for numbers as keys but numbers as keys aren't allowed in GraphQL fragments. See the below example.

"2019" : {
      type: String,
      //more
}
eric-burel commented 4 years ago

Solution would be to throw an error with an explicit schema when creating the graphql schema.

Schema keys must respect the Graphql "Name" pattern defined in the standard https://graphql.github.io/graphql-spec/June2018/#sec-Names

time4Wiley commented 4 years ago

@eric-burel

Hi Eric, I am new to VulcanJS, but I want to join in the development.

For this issue, as I understand, the fix is to

  1. check schema keys against the Graphql name pattern
  2. when the check fails, throw an error with schema containing the illegal keys.

Would you help to verify the above rephrasing? That will help to build some confidence for me to go further with the implementation.

GAURAV1-ui commented 2 years ago

Hey @eric-burel can I work on this issue?

eric-burel commented 2 years ago

Hi, the Meteor version is deprecated so it's ok to contribute but it's better to work on Vulcan Next/ Vulcan NPM: https://vulcan-docs.vercel.app/