Skip to content

Instantly share code, notes, and snippets.

@takashimamorino
Last active January 18, 2022 01:59
Show Gist options
  • Save takashimamorino/edc12385cb077ee295af652069df08d8 to your computer and use it in GitHub Desktop.
Save takashimamorino/edc12385cb077ee295af652069df08d8 to your computer and use it in GitHub Desktop.
[memo] codegen の scalars オプションに graphql-scalars で定義している scalar type を一括で定義できるようにする

やりたいこと

Urigo/graphql-scalars の scalr type を codegen の scalrs オプションにひとつずつ登録するのがめんどくさい これをまとめて登録したい

  scalars:
    JWT: string
    EmailAddress: string

関係 PR/Issue

  scalars:
    DateTime: Date
    JSON: { [key: string]: any }
    CustomType: ../scalars#CustomType
  
  // or
  
  scalars: ../scalars

上記の方法で codegen の scalars をまとめるのはいけるっぽい

graphql-scalars に対応する型をまとめる案の PR が Issue がある ただし自分で実装するようになっている

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment