[MGNLGQL-48] Sanitize content type names when creating GraphQL schemas Created: 19/Aug/20 Updated: 25/Mar/22 |
|
| Status: | Open |
| Project: | Magnolia GraphQL |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Neutral |
| Reporter: | Martin Drápela | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoR: |
Empty
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
Problem description Ever since DOCS57, we have been implicitly allowing dashes in content type filenames:
(https://documentation.magnolia-cms.com/display/DOCS62/Content+type+definition) However, dashes create an issue for GraphQL schemas: 2020-08-19 08:48:51,572 ERROR info.magnolia.event.SimpleEventBus : Exception caught when dispatching info.magnolia.graphql.core.GraphQLDefinitionChangedEvent with info.magnolia.graphql.core.GraphQLProvider$$Lambda$786/1987165365 eventHandler. graphql.AssertException: Name must be non-null, non-empty and match [_A-Za-z][_0-9A-Za-z]* - was 'Bookshelf-app' at graphql.Assert.assertValidName(Assert.java:107) ~[graphql-java-14.1.jar:?] at graphql.schema.FieldCoordinates.assertValidNames(FieldCoordinates.java:50) ~[graphql-java-14.1.jar:?] https://spec.graphql.org/June2018/#sec-Names (2.1.9 Names):
Task We should either:
|
| Comments |
| Comment by Christopher Zimmermann [ 25/Feb/21 ] |
|
The screenshots are a bit misleading "create-content-type" is not the name of the content type, it is the name of the CLI command. So I dont think there should be red underlingin of those - that is confusing, as it is not the problem. |