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

Creating an object/field with a name not compliant with GraphQL type names breaks the schema #4943

Closed
Weiko opened this issue Apr 12, 2024 · 0 comments · Fixed by #5063
Closed
Assignees

Comments

@Weiko
Copy link
Member

Weiko commented Apr 12, 2024

Scope & Context

Each workspace has its own objects and graphql schema, defined through some metadata (objects, fields, relations, ...).
If I create an object named "person", I should be able to query the API to retrieve my records of the Person object. The schema will have a Person type and its associated resolvers. Twenty will dynamically generate something like this:

query Person {
  person(filter: {id: { eq: "something"}}) {
    id
  }
}

This works well in most of the cases however Graphql does not accept type names such as "1Event" or "한국어", which means we need to also have the same kind of validation on our metadata names definition.

Technical inputs

Transliteration libraries could help with languages that use characters not accepted by Graphql regex, we will also need to escape special characters and numbers (or at least the ones that start with a number)

@ijreilly ijreilly self-assigned this Apr 17, 2024
@ijreilly ijreilly moved this from 🆕 New to 👀 In review in Product development ✅ Apr 19, 2024
Weiko added a commit that referenced this issue Apr 23, 2024
Fixes #4943

## How was it tested?
Local (front + /metadata)
Unit tests for utils

---------

Co-authored-by: Weiko <[email protected]>
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Product development ✅ Apr 23, 2024
arnavsaxena17 pushed a commit to arnavsaxena17/twenty that referenced this issue Oct 6, 2024
Fixes twentyhq#4943

## How was it tested?
Local (front + /metadata)
Unit tests for utils

---------

Co-authored-by: Weiko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
2 participants