Skip to content

Commit

Permalink
v3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
babyfish-ct committed Jun 22, 2022
1 parent aa6d497 commit b7c47fc
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 266 deletions.
48 changes: 22 additions & 26 deletions codegen/dist/EnumInputMetadataWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,29 @@ class EnumInputMetadataWriter extends Writer_1.Writer {
this.collectEnumMetaTypes(type, processedTypeNames, enumInputMetaTypeMap);
}
}
this.text("export const ENUM_INPUT_METADATA = ");
this.scope({ type: "BLANK", multiLines: true }, () => {
this.text("new EnumInputMetadataBuilder()\n");
for (const [typeName, fields] of enumInputMetaTypeMap) {
this.text('.add("');
this.text(typeName);
this.text('"');
if (fields !== undefined) {
this.text(", ");
this.scope({ type: "ARRAY", multiLines: true }, () => {
for (const field of fields) {
this.separator(", ");
this.scope({ type: "BLOCK" }, () => {
this.text('name: \"');
this.text(field.name);
this.text('", typeName: "');
this.text(EnumInputMetadataWriter.inputTypeName(field.type));
this.text('"');
});
}
});
}
this.text(")\n");
this.text("const builder = new EnumInputMetadataBuilder();\n");
for (const [typeName, fields] of enumInputMetaTypeMap) {
this.text('\nbuilder.add("');
this.text(typeName);
this.text('"');
if (fields !== undefined) {
this.text(", ");
this.scope({ type: "ARRAY", multiLines: true }, () => {
for (const field of fields) {
this.separator(", ");
this.scope({ type: "BLOCK" }, () => {
this.text('name: \"');
this.text(field.name);
this.text('", typeName: "');
this.text(EnumInputMetadataWriter.inputTypeName(field.type));
this.text('"');
});
}
});
}
this.text(".build()");
});
this.text(";");
this.text(");\n");
}
this.text("\nexport const ENUM_INPUT_METADATA = builder.build();\n");
}
collectEnumMetaTypes(type, processedTypeNames, outMap) {
if (type instanceof graphql_1.GraphQLScalarType) {
Expand Down
48 changes: 22 additions & 26 deletions codegen/src/EnumInputMetadataWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,29 @@ export class EnumInputMetadataWriter extends Writer {
this.collectEnumMetaTypes(type, processedTypeNames, enumInputMetaTypeMap);
}
}
this.text("export const ENUM_INPUT_METADATA = ");
this.scope({type: "BLANK", multiLines: true}, () => {
this.text("new EnumInputMetadataBuilder()\n");
for (const [typeName, fields] of enumInputMetaTypeMap) {
this.text('.add("');
this.text(typeName);
this.text('"');
if (fields !== undefined) {
this.text(", ");
this.scope({type: "ARRAY", multiLines: true}, () => {
for (const field of fields) {
this.separator(", ");
this.scope({type: "BLOCK"}, () => {
this.text('name: \"');
this.text(field.name)
this.text('", typeName: "');
this.text(EnumInputMetadataWriter.inputTypeName(field.type));
this.text('"');
});
}
});
}
this.text(")\n");
this.text("const builder = new EnumInputMetadataBuilder();\n");
for (const [typeName, fields] of enumInputMetaTypeMap) {
this.text('\nbuilder.add("');
this.text(typeName);
this.text('"');
if (fields !== undefined) {
this.text(", ");
this.scope({type: "ARRAY", multiLines: true}, () => {
for (const field of fields) {
this.separator(", ");
this.scope({type: "BLOCK"}, () => {
this.text('name: \"');
this.text(field.name)
this.text('", typeName: "');
this.text(EnumInputMetadataWriter.inputTypeName(field.type));
this.text('"');
});
}
});
}
this.text(".build()");
});
this.text(";");
this.text(");\n");
}
this.text("\nexport const ENUM_INPUT_METADATA = builder.build();\n");
}

private collectEnumMetaTypes(
Expand Down
128 changes: 0 additions & 128 deletions codegen/yarn-error.log

This file was deleted.

4 changes: 2 additions & 2 deletions example/client/apollo-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"graphql": "^15.5.1",
"graphql-ts-client-api": "^3.1.5",
"graphql-ts-client-api": "^3.1.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
Expand Down Expand Up @@ -50,6 +50,6 @@
]
},
"devDependencies": {
"graphql-ts-client-codegen": "^3.1.5"
"graphql-ts-client-codegen": "^3.1.6"
}
}
17 changes: 9 additions & 8 deletions example/client/apollo-demo/src/__generated/EnumInputMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { EnumInputMetadataBuilder } from 'graphql-ts-client-api';

export const ENUM_INPUT_METADATA =
new EnumInputMetadataBuilder()
.add("Gender")
.add("EmployeeInput", [
{name: "gender", typeName: "Gender"}
])
.build()
;
const builder = new EnumInputMetadataBuilder();

builder.add("Gender");

builder.add("EmployeeInput", [
{name: "gender", typeName: "Gender"}
]);

export const ENUM_INPUT_METADATA = builder.build();
16 changes: 8 additions & 8 deletions example/client/apollo-demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5527,17 +5527,17 @@ graphql-tag@^2.12.3:
dependencies:
tslib "^2.1.0"

graphql-ts-client-api@^3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/graphql-ts-client-api/-/graphql-ts-client-api-3.1.5.tgz#aaf7dd41ee06a903079b06ed1c551ec138dd9521"
integrity sha512-irLWGkkyusiWHkI7B3LoAYa1nLuII7UjuQ0BXy78T4DrReU6UK5lI5ZKMobmFVQYIkjyNcXbCvOceerB5OuepQ==
graphql-ts-client-api@^3.1.6:
version "3.1.6"
resolved "https://registry.yarnpkg.com/graphql-ts-client-api/-/graphql-ts-client-api-3.1.6.tgz#64d281293f42ba42efcbf57bc113abbf8af04f6d"
integrity sha512-L+doXlwMjcA+5tCeZWCZxECFNOmnk7o5BGhO9VVCDg4qqPUSOS46xhD6VbckV/vz/iviOD1dAfbyT/wBNSH22Q==
dependencies:
ts-md5 "^1.2.9"

graphql-ts-client-codegen@^3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/graphql-ts-client-codegen/-/graphql-ts-client-codegen-3.1.5.tgz#91920e85c274a06ebafd62e61581849a4368e7f6"
integrity sha512-GFu300xP5T2AlJBIkAIwVNNGidY51HpIAZeyE2TSufV52eO48AF3X8YAzRRyO4ukRighq6Ovy++JAGrCAXiXZQ==
graphql-ts-client-codegen@^3.1.6:
version "3.1.6"
resolved "https://registry.yarnpkg.com/graphql-ts-client-codegen/-/graphql-ts-client-codegen-3.1.6.tgz#4681eca625ab0398fc74c3ae260efc555c648519"
integrity sha512-FcH+2KUSxK7rxs2YxktEbPxiTusZVXIENi1fOhu8i9SCMncvkirAQezI8ScgAff1n2ZTdAszCnGHVE3+VuOphA==
dependencies:
"@types/node" "^15.12.2"
"@types/node-fetch" "^2.5.10"
Expand Down
4 changes: 2 additions & 2 deletions example/client/async-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"graphql-ts-client-api": "^3.1.5",
"graphql-ts-client-api": "^3.1.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"devDependencies": {
"graphql": "^15.5.0",
"graphql-ts-client-codegen": "^3.1.5",
"graphql-ts-client-codegen": "^3.1.6",
"node-fetch": "^2.6.1"
}
}
17 changes: 9 additions & 8 deletions example/client/async-demo/src/__generated/EnumInputMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { EnumInputMetadataBuilder } from 'graphql-ts-client-api';

export const ENUM_INPUT_METADATA =
new EnumInputMetadataBuilder()
.add("Gender")
.add("EmployeeInput", [
{name: "gender", typeName: "Gender"}
])
.build()
;
const builder = new EnumInputMetadataBuilder();

builder.add("Gender");

builder.add("EmployeeInput", [
{name: "gender", typeName: "Gender"}
]);

export const ENUM_INPUT_METADATA = builder.build();
16 changes: 8 additions & 8 deletions example/client/async-demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5439,17 +5439,17 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==

graphql-ts-client-api@^3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/graphql-ts-client-api/-/graphql-ts-client-api-3.1.5.tgz#aaf7dd41ee06a903079b06ed1c551ec138dd9521"
integrity sha512-irLWGkkyusiWHkI7B3LoAYa1nLuII7UjuQ0BXy78T4DrReU6UK5lI5ZKMobmFVQYIkjyNcXbCvOceerB5OuepQ==
graphql-ts-client-api@^3.1.6:
version "3.1.6"
resolved "https://registry.yarnpkg.com/graphql-ts-client-api/-/graphql-ts-client-api-3.1.6.tgz#64d281293f42ba42efcbf57bc113abbf8af04f6d"
integrity sha512-L+doXlwMjcA+5tCeZWCZxECFNOmnk7o5BGhO9VVCDg4qqPUSOS46xhD6VbckV/vz/iviOD1dAfbyT/wBNSH22Q==
dependencies:
ts-md5 "^1.2.9"

graphql-ts-client-codegen@^3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/graphql-ts-client-codegen/-/graphql-ts-client-codegen-3.1.5.tgz#91920e85c274a06ebafd62e61581849a4368e7f6"
integrity sha512-GFu300xP5T2AlJBIkAIwVNNGidY51HpIAZeyE2TSufV52eO48AF3X8YAzRRyO4ukRighq6Ovy++JAGrCAXiXZQ==
graphql-ts-client-codegen@^3.1.6:
version "3.1.6"
resolved "https://registry.yarnpkg.com/graphql-ts-client-codegen/-/graphql-ts-client-codegen-3.1.6.tgz#4681eca625ab0398fc74c3ae260efc555c648519"
integrity sha512-FcH+2KUSxK7rxs2YxktEbPxiTusZVXIENi1fOhu8i9SCMncvkirAQezI8ScgAff1n2ZTdAszCnGHVE3+VuOphA==
dependencies:
"@types/node" "^15.12.2"
"@types/node-fetch" "^2.5.10"
Expand Down
6 changes: 3 additions & 3 deletions example/client/relay-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"@types/react-relay": "^11.0.2",
"@types/relay-runtime": "^11.0.3",
"antd": "^4.16.13",
"graphql-ts-client-api": "^3.1.5",
"graphql-ts-client-relay": "^3.1.5",
"graphql-ts-client-api": "^3.1.6",
"graphql-ts-client-relay": "^3.1.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-relay": "^12.0.0",
Expand Down Expand Up @@ -51,6 +51,6 @@
]
},
"devDependencies": {
"graphql-ts-client-codegen": "^3.1.5"
"graphql-ts-client-codegen": "^3.1.6"
}
}
Loading

0 comments on commit b7c47fc

Please sign in to comment.