wrap-cli icon indicating copy to clipboard operation
wrap-cli copied to clipboard

Suport "rename" annotate directive in schema

Open fetsorn opened this issue 1 year ago • 1 comments

Add "rename" feature to the annotate directive in GraphQL type.

MarketData2(helloWorld=md1.hello_world)
type MarketData1 {
   hello-world: String! @annotate(rename="helloWorld", exclude=true)
}
 
type MarketData2 {
  helloWorld: String!
}
md1: MarketData1
md2 = md1.transform()

fetsorn avatar Aug 17 '22 15:08 fetsorn

I'd expand this in the ability to add schema transformations: Here are some common transformations:

  1. rename field while transforming
    • field/type aliases for the types that can't be represented in programming langs
    • rename the field to the desired name
  2. exclude selected fields
  3. only include selected fields
  4. transform array of pair into a map and vice-versa
  5. Can in future support many such transformations if needed to

Niraj-Kamdar avatar Sep 02 '22 09:09 Niraj-Kamdar