Open ddcollins opened 3 years ago
It's specifically this transform:
typeNames: pascalCase
Could you share more details and a reproduction if possible?
Could you share more details and a reproduction if possible?
This is my mesh config
sources:
- name: DirectusAcademy
handler:
graphql:
endpoint: ${DIRECTUS_HOST}
schemaHeaders:
Authorization: Bearer ${DIRECTUS_API_TOKEN}
operationHeaders:
Authorization: Bearer ${DIRECTUS_API_TOKEN}
batch: false
transforms:
# Global
- resolversComposition:
- resolver: 'Query.*'
composer: ./src/middleware/api-token-guard.js
- resolver: 'Mutation.*'
composer: ./src/middleware/api-token-guard.js
- namingConvention:
typeNames: pascalCase
enumValues: upperCase
fieldNames: camelCase
serve:
port: 5000
We are hooking into Directus which has "many to any" relational support
e.g.
Lesson has "steps", and that step could be a "Lesson Slide", "Lesson Video", etc object.
Previous to the transforms the query was:
{
items {
course(limit:10) {
id
title
description
lessons {
title
sub_title
can_preview
description
steps {
step_title
can_preview
item {
... on lesson_slide {
content
status
image_url
}
... on lesson_video {
video_url
}
}
}
}
}
}
}
My theory is that it's still looking for the snake case type name for lesson_slide
and lesson_video
and not the transformed pascal case
Here's a repo I set up with instructions on how to replicate this! https://github.com/ddcollins/mesh-directus-replication
Adding the naming convention transform:
Results in the following error:
When trying to run the following query:
This query works fine when the naming convention transform is removed. The query also works fine if I remove:
The query is through my graphql handler.
Dependencies: