Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support types mapping include float #532

Merged
merged 5 commits into from
Nov 16, 2021
Merged

Support types mapping include float #532

merged 5 commits into from
Nov 16, 2021

Conversation

jiqiang90
Copy link
Contributor

Closes #530

@ianhe8x
Copy link
Collaborator

ianhe8x commented Oct 17, 2021

Better we refactor the type mapping related codes in this PR. It's very easy to miss things when adding a new type. For example the part that related to POI.

@jiqiang90 jiqiang90 changed the title Support float type Support types mapping include float Oct 22, 2021
@jiqiang90 jiqiang90 mentioned this pull request Oct 23, 2021
return Object.keys(supportedTypes).findIndex((k) => k === type) > -1;
}

export class GeneralTypes {
Copy link
Collaborator

@ianhe8x ianhe8x Oct 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel you just need a getTypeByScalarName(): TypeInterfaces, instead of a class.

toTsType: TypeScalar | undefined;
toFieldScalar: FieldScalar | undefined;
toSequelizeType: SequelizeTypes | undefined;
toStoreOperation(data: any): Uint8Array | undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
toStoreOperation(data: any): Uint8Array | undefined;
toHashCode(data: any): Uint8Array | undefined;


export const Json = {
toFieldScalar: undefined,
toTsType: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unknown

@jiqiang90 jiqiang90 force-pushed the support-float-type branch 5 times, most recently from cc88157 to 172cae3 Compare November 13, 2021 05:52
@@ -223,9 +224,9 @@ export function setJsonObjectType(
return graphQLJsonObject;
}

type GraphQLNonListType = GraphQLScalarType | GraphQLObjectType<unknown, unknown>; // check | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType;
type GraphQLNonListType = GraphQLScalarType | GraphQLObjectType<any, any>; // check | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unknown dose look better here

@ianhe8x ianhe8x merged commit 41a11ac into main Nov 16, 2021
@ianhe8x ianhe8x deleted the support-float-type branch November 16, 2021 04:02
bz888 pushed a commit that referenced this pull request Jun 3, 2022
* support float and types mapping,change eslint complexity back to 20 , add bn.js to dependency in common

* Fix bn.js dependency

* change BN to bn

* remove bn.js in dependencies

* fix extractType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support float type
2 participants