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

Remove legacy keystone.dumpSchema() #5154

Merged
merged 1 commit into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pretty-mirrors-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/keystone-legacy': major
---

Removed unused `keystone.dumpSchema()`.
1 change: 0 additions & 1 deletion packages/keystone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ Please note: We use these internally but provide no support or assurance if used

| Method | Description |
| --------------------- | ---------------------------------------------------------------------------- |
| `dumpSchema` | Dump schema to a string. |
| `getTypeDefs` | Remove from user documentation? |
| `getResolvers` | Remove from user documentation? |
| `getAdminMeta` | Remove from user documentation? |
Expand Down
8 changes: 1 addition & 7 deletions packages/keystone/lib/Keystone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const flattenDeep = require('lodash.flattendeep');
const memoize = require('micro-memoize');
const falsey = require('falsey');
const createCorsMiddleware = require('cors');
const { execute, print } = require('graphql');
const { execute } = require('graphql');
const { GraphQLUpload } = require('graphql-upload');
const {
arrayToObject,
Expand Down Expand Up @@ -531,12 +531,6 @@ module.exports = class Keystone {
);
}

dumpSchema(schemaName = 'public') {
return this.getTypeDefs({ schemaName })
.map(t => print(t))
.join('\n');
}

async _prepareMiddlewares({ dev, apps, distDir, pinoOptions, cors }) {
return flattenDeep([
// Used by other middlewares such as authentication strategies. Important
Expand Down
23 changes: 0 additions & 23 deletions packages/keystone/tests/Keystone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,6 @@ test('Check require', () => {
expect(Keystone).not.toBeNull();
});

test('unique typeDefs', () => {
const config = {
adapter: new MockAdapter(),
cookieSecret: 'secretForTesting',
};
const keystone = new Keystone(config);

keystone.createList('User', {
fields: {
images: { type: MockFieldType },
},
});

keystone.createList('Post', {
fields: {
hero: { type: MockFieldType },
},
});
const schema = keystone.dumpSchema();
expect(schema.match(/scalar Foo/g) || []).toHaveLength(1);
expect(schema.match(/getFoo: Boolean/g) || []).toHaveLength(1);
});

describe('Keystone.createList()', () => {
test('basic', () => {
const config = {
Expand Down