You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we're jumping through some hoops to get GraphQL- / TypeScript-safe enum values. Those are not safe by default, as used in our JSON schema (e.g. 16:9, or just simply 1).
As in: you can't deterministically convert values back to their original form, once they are made safe. This is why different properties (like ratio or pattern) need to be handled explicitly here, to reconstruct the needed format. As properties can be customized from a project-level (e.g. pattern already is an individualization for kickstartDS/design-system) we can't have custom handling per property here. At least in the long run!
Another difference is the handling of - vs _. Should be consistent, and need no extra handling while converting.
Right now we're jumping through some hoops to get GraphQL- / TypeScript-safe enum values. Those are not safe by default, as used in our JSON schema (e.g.
16:9
, or just simply1
).We use the following code to make them safe, but it's destructive in nature:
https://github.com/kickstartDS/kickstartDS-schema-toolkit/blob/master/jsonschema2graphql/src/graphqlSafeEnumKey.ts
https://github.com/kickstartDS/kickstartDS-schema-toolkit/blob/master/jsonschema2netlifycms/src/safeEnumKey.ts
As in: you can't deterministically convert values back to their original form, once they are made safe. This is why different properties (like
ratio
orpattern
) need to be handled explicitly here, to reconstruct the needed format. As properties can be customized from a project-level (e.g.pattern
already is an individualization forkickstartDS/design-system
) we can't have custom handling per property here. At least in the long run!Another difference is the handling of
-
vs_
. Should be consistent, and need no extra handling while converting.Also see the
TODOs
here: https://github.com/kickstartDS/gatsby-theme-kickstartDS/blob/master/gatsby-theme-kickstartds/src/components/KickstartDSPageComponent.tsx#L47-L52The text was updated successfully, but these errors were encountered: