How can we parse and modify a schema with makeAugmentedSchema

161 views Asked by At

Related question.

I'm trying to add the internationalization feature to my database. It would be quite difficult to maintain a schema graphql if I needed to duplicate all translatable fields

I'm already using makeAugmentedSchema with schemaTransforms to add custom function directives.

But now, I'd like to remove fields containing a directive and replace them with new fields

type Quest {  # Before schema augmentation
    name @i18n
} 

type Quest {  # After schema augmentation
    nameEn
    nameJa
    nameFr
    ...
}

I couldn't find examples of code doing something similar. Usually, it's about stitching schemas, or concatenating them together.

Do you know of a resource or code that I could get inspiration from to get this working ?

If it's relevant, I'm using the GRANDstack with neo4j, neo4j-graphql-js and Apollo server.

0

There are 0 answers