Skip to content

Commit

Permalink
chore(deps): upgrade GraphQL (#1541)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Oct 18, 2021
1 parent 04ef23e commit e3d75b4
Show file tree
Hide file tree
Showing 5 changed files with 7,106 additions and 7,127 deletions.
6 changes: 3 additions & 3 deletions postgraphiql/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4864,9 +4864,9 @@ graphql-language-service@^3.1.2:
graphql-language-service-types "^1.8.0"

graphql@^15.4.0:
version "15.4.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.4.0.tgz#e459dea1150da5a106486ba7276518b5295a4347"
integrity sha512-EB3zgGchcabbsU9cFe1j+yxdzKQKAbGUWRb13DsrsMN1yyfmmIq+2+L5MqVWcDCE4V89R5AyUOi7sMOGxdsYtA==
version "15.6.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.6.1.tgz#9125bdf057553525da251e19e96dab3d3855ddfc"
integrity sha512-3i5lu0z6dRvJ48QP9kFxBkJ7h4Kso7PS8eahyTFz5Jm6CvQfLtNIE8LX9N6JLnXTuwR+sIYnXzaWp6anOg0QQw==

growly@^1.3.0:
version "1.3.0"
Expand Down
36 changes: 2 additions & 34 deletions src/__tests__/utils/printSchemaOrdered.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
import { parse, buildASTSchema } from 'graphql';
import { printSchema } from 'graphql/utilities';
import { lexicographicSortSchema, printSchema } from 'graphql/utilities';

export default function printSchemaOrdered(originalSchema) {
// Clone schema so we don't damage anything
const schema = buildASTSchema(parse(printSchema(originalSchema)));

const typeMap = schema.getTypeMap();
Object.keys(typeMap).forEach(name => {
const gqlType = typeMap[name];

// Object?
if (gqlType.getFields) {
const fields = gqlType.getFields();
const keys = Object.keys(fields).sort();
keys.forEach(key => {
const value = fields[key];

// Move the key to the end of the object
delete fields[key];
fields[key] = value;

// Sort args
if (value.args) {
value.args.sort((a, b) => a.name.localeCompare(b.name));
}
});
}

// Enum?
if (gqlType.getValues) {
gqlType.getValues().sort((a, b) => a.name.localeCompare(b.name));
}
});

return printSchema(schema);
return printSchema(lexicographicSortSchema(originalSchema));
}
Loading

0 comments on commit e3d75b4

Please sign in to comment.