graphql-schema icon indicating copy to clipboard operation
graphql-schema copied to clipboard

feat: add types for known scalars

Open jbreckel opened this issue 2 years ago • 1 comments

Description

Scalars that are of type string according to their documentation are now also of type string in the generated typescript defintions.

By default, new scalars will now be of type unknown. Known scalars are defined in codegen.json with their respective type.

Context

Using any is discuraged and should avoided. Using the type safe unknown is encouraged. (see here). The new defaultScalarType is now unknown, scalars with a specific underlying type can be added to codegen.json to have their correct typescript type.

Closes #560

jbreckel avatar Nov 29 '21 09:11 jbreckel

I cannot answer to wether the scalars are strings. Otherwise it looks good.

Unfortunately, the JS octokit packages don't have an active maintainer anymore, so we cannot update release new changes.

You can check out this discussion for further updates

wolfy1339 avatar Nov 29 '21 22:11 wolfy1339

@jbreckel Are you still interested in moving this forward? There have been some changes, can you rebase your branch

wolfy1339 avatar Mar 04 '24 19:03 wolfy1339