From dd5c408396a7eff1c21d3207cbf0347a5dca499b Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Mon, 27 Jul 2020 15:36:40 -0700 Subject: [PATCH] refactor: add @loopback/example-graphql Signed-off-by: Raymond Feng --- CODEOWNERS | 1 + docs/site/MONOREPO.md | 1 + examples/graphql/.npmrc | 1 + .../graphql-test => examples/graphql}/LICENSE | 6 +- examples/graphql/README.md | 75 ++ .../graphql/graphql-demo.png | Bin examples/graphql/package-lock.json | 1012 +++++++++++++++++ examples/graphql/package.json | 70 ++ .../graphql}/public/index.html | 0 .../graphql-middleware.acceptance.ts | 10 +- .../src/__tests__/acceptance/graphql-tests.ts | 4 +- .../acceptance/graphql.acceptance.ts | 16 +- .../graphql}/src/application.ts | 8 +- .../graphql}/src/datasources/README.md | 0 .../graphql}/src/datasources/index.ts | 4 +- .../src/datasources/recipes.datasource.ts | 4 +- .../src/graphql-resolvers/recipe-resolver.ts | 10 +- .../src/graphql-types/recipe-input.ts | 6 +- .../graphql}/src/graphql-types/recipe-type.ts | 6 +- .../graphql}/src/index.ts | 8 +- .../graphql}/src/migrate.ts | 8 +- .../graphql}/src/repositories/README.md | 0 .../graphql}/src/repositories/index.ts | 4 +- .../src/repositories/recipe.repository.ts | 4 +- .../graphql}/src/sample-recipes.ts | 4 +- .../graphql}/src/services/recipe.service.ts | 4 +- examples/graphql/tsconfig.json | 33 + extensions/graphql/README.md | 57 +- extensions/graphql/package-lock.json | 142 +-- extensions/graphql/package.json | 7 +- .../__examples__/graphql-test/package.json | 49 - tsconfig.json | 3 + 32 files changed, 1329 insertions(+), 228 deletions(-) create mode 100644 examples/graphql/.npmrc rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/LICENSE (91%) create mode 100644 examples/graphql/README.md rename {extensions => examples}/graphql/graphql-demo.png (100%) create mode 100644 examples/graphql/package-lock.json create mode 100644 examples/graphql/package.json rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/public/index.html (100%) rename {extensions => examples}/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts (68%) rename {extensions => examples}/graphql/src/__tests__/acceptance/graphql-tests.ts (97%) rename {extensions => examples}/graphql/src/__tests__/acceptance/graphql.acceptance.ts (77%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/application.ts (85%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/datasources/README.md (100%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/datasources/index.ts (62%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/datasources/recipes.datasource.ts (92%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/graphql-resolvers/recipe-resolver.ts (91%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/graphql-types/recipe-input.ts (71%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/graphql-types/recipe-type.ts (89%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/index.ts (85%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/migrate.ts (78%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/repositories/README.md (100%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/repositories/index.ts (62%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/repositories/recipe.repository.ts (95%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/sample-recipes.ts (90%) rename {extensions/graphql/src/__examples__/graphql-test => examples/graphql}/src/services/recipe.service.ts (81%) create mode 100644 examples/graphql/tsconfig.json delete mode 100644 extensions/graphql/src/__examples__/graphql-test/package.json diff --git a/CODEOWNERS b/CODEOWNERS index b9f87066911e..06834a6aebd3 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -321,6 +321,7 @@ # - Issue label: GraphQL # - Primary owner(s): @raymondfeng /extensions/graphql @raymondfeng +/examples/graphql @raymondfeng # # Build & internal tooling diff --git a/docs/site/MONOREPO.md b/docs/site/MONOREPO.md index 425cf344c82c..3a3d6c442cf3 100644 --- a/docs/site/MONOREPO.md +++ b/docs/site/MONOREPO.md @@ -21,6 +21,7 @@ one in the monorepo: `npm run update-monorepo-file` | [examples/context](https://github.com/strongloop/loopback-next/tree/master/examples/context) | @loopback/example-context | Standalone examples to illustrate features provided by @loopback/context | | [examples/express-composition](https://github.com/strongloop/loopback-next/tree/master/examples/express-composition) | @loopback/example-express-composition | LoopBack 4 REST API on Express | | [examples/file-transfer](https://github.com/strongloop/loopback-next/tree/master/examples/file-transfer) | @loopback/example-file-transfer | Example application for file upload/download with LoopBack 4 | +| [examples/graphql](https://github.com/strongloop/loopback-next/tree/master/examples/graphql) | @loopback/example-graphql | GraphQL Example Application | | [examples/greeter-extension](https://github.com/strongloop/loopback-next/tree/master/examples/greeter-extension) | @loopback/example-greeter-extension | An example showing how to implement the extension point/extension pattern using LoopBack 4 | | [examples/greeting-app](https://github.com/strongloop/loopback-next/tree/master/examples/greeting-app) | @loopback/example-greeting-app | An example greeting application for LoopBack 4 | | [examples/hello-world](https://github.com/strongloop/loopback-next/tree/master/examples/hello-world) | @loopback/example-hello-world | A simple hello-world Application using LoopBack 4 | diff --git a/examples/graphql/.npmrc b/examples/graphql/.npmrc new file mode 100644 index 000000000000..cafe685a112d --- /dev/null +++ b/examples/graphql/.npmrc @@ -0,0 +1 @@ +package-lock=true diff --git a/extensions/graphql/src/__examples__/graphql-test/LICENSE b/examples/graphql/LICENSE similarity index 91% rename from extensions/graphql/src/__examples__/graphql-test/LICENSE rename to examples/graphql/LICENSE index a063093ecb7b..235b91329cbe 100644 --- a/extensions/graphql/src/__examples__/graphql-test/LICENSE +++ b/examples/graphql/LICENSE @@ -1,12 +1,12 @@ -Copyright (c) IBM Corp. 2019. -Node module: graphql-test +Copyright (c) IBM Corp. 2020. +Node module: @loopback/example-graphql This project is licensed under the MIT License, full text below. -------- MIT License -MIT License Copyright (c) IBM Corp. 2019 +MIT License Copyright (c) IBM Corp. 2020 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/examples/graphql/README.md b/examples/graphql/README.md new file mode 100644 index 000000000000..e98aa9f341ed --- /dev/null +++ b/examples/graphql/README.md @@ -0,0 +1,75 @@ +# @loopback/example-graphql + +An example application to demonstrate GraphQL integration for LoopBack 4 using +[@loopback/graphql](https://github.com/strongloop/loopback-next/tree/graphql/extensions/graphql). + +## Try it out + +```sh +npm start +``` + +You should see the following messages: + +```sh +Server is running at http://[::1]:3000 +Try http://[::1]:3000/graphql +``` + +Open http://127.0.0.1:3000/graphql in your browser to play with the GraphiQL. + +![graphql-demo](graphql-demo.png) + +1. Copy the query to the right panel: + +```graphql +query GetRecipe1 { + recipe(recipeId: "1") { + title + description + ratings + creationDate + ratingsCount(minRate: 2) + averageRating + ingredients + numberInCollection + } +} +``` + +2. Click on the run icon: + +```json +{ + "data": { + "recipe": { + "title": "Recipe 1", + "description": "Desc 1", + "ratings": [0, 3, 1], + "creationDate": "2018-04-11T00:00:00.000Z", + "ratingsCount": 1, + "averageRating": 1.3333333333333333, + "ingredients": ["one", "two", "three"], + "numberInCollection": 1 + } + } +} +``` + +## Contributions + +- [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md) +- [Join the team](https://github.com/strongloop/loopback-next/issues/110) + +## Tests + +Run `npm test` from the root folder. + +## Contributors + +See +[all contributors](https://github.com/strongloop/loopback-next/graphs/contributors). + +## License + +MIT diff --git a/extensions/graphql/graphql-demo.png b/examples/graphql/graphql-demo.png similarity index 100% rename from extensions/graphql/graphql-demo.png rename to examples/graphql/graphql-demo.png diff --git a/examples/graphql/package-lock.json b/examples/graphql/package-lock.json new file mode 100644 index 000000000000..edcbf598dbc4 --- /dev/null +++ b/examples/graphql/package-lock.json @@ -0,0 +1,1012 @@ +{ + "name": "@loopback/example-graphql", + "version": "0.0.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "@types/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/connect": { + "version": "3.4.33", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", + "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/express": { + "version": "4.17.7", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.7.tgz", + "integrity": "sha512-dCOT5lcmV/uC2J9k0rPafATeeyz+99xTt54ReX11/LObZgfzJqZNcW27zGhYyX+9iSEGXGt5qLPwRSvBZcLvtQ==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.9.tgz", + "integrity": "sha512-DG0BYg6yO+ePW+XoDENYz8zhNGC3jDDEpComMYn7WJc4mY1Us8Rw9ax2YhJXxpyk2SF47PQAoQ0YyVT1a0bEkA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/mime": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz", + "integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==", + "dev": true + }, + "@types/multer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.4.3.tgz", + "integrity": "sha512-tWsKbF5LYtXrJ7eOfI0aLBgEv9B7fnJe1JRXTj5+Z6EMfX0yHVsRFsNGnKyN8Bs0gtDv+JR37xAqsPnALyVTqg==", + "dev": true, + "requires": { + "@types/express": "*" + } + }, + "@types/node": { + "version": "10.17.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz", + "integrity": "sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ==", + "dev": true + }, + "@types/qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==", + "dev": true + }, + "@types/serve-static": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.4.tgz", + "integrity": "sha512-jTDt0o/YbpNwZbQmE/+2e+lfjJEJJR0I3OFaKQKPWkASkCoW3i6fsUnqudSMcNAfbtmADGu8f4MV4q+GqULmug==", + "dev": true, + "requires": { + "@types/express-serve-static-core": "*", + "@types/mime": "*" + } + }, + "acorn": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, + "ajv": { + "version": "6.12.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", + "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "class-transformer": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.2.3.tgz", + "integrity": "sha512-qsP+0xoavpOlJHuYsQJsN58HXSl8Jvveo+T37rEvCEeRfMWoytAyR0Ua/YsFgpM6AZYZ/og2PJwArwzJl1aXtQ==" + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.5.0.tgz", + "integrity": "sha512-vlUP10xse9sWt9SGRtcr1LAC67BENcQMFeV+w5EvLEoFe3xJ8cF1Skd0msziRx/VMC+72B4DxreCE+OR12OA6Q==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.2.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", + "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "dev": true, + "requires": { + "acorn": "^7.3.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "tslib": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", + "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typescript": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + } + } +} diff --git a/examples/graphql/package.json b/examples/graphql/package.json new file mode 100644 index 000000000000..0ffc9dcbc692 --- /dev/null +++ b/examples/graphql/package.json @@ -0,0 +1,70 @@ +{ + "name": "@loopback/example-graphql", + "version": "0.0.1", + "description": "GraphQL Example Application", + "keywords": [ + "loopback-application", + "loopback" + ], + "main": "dist/index.js", + "types": "dist/index.d.ts", + "engines": { + "node": ">=10.16" + }, + "publishConfig": { + "access": "public" + }, + "scripts": { + "acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"", + "build": "lb-tsc", + "build:watch": "lb-tsc --watch", + "clean": "lb-clean *example-graphql*.tgz dist *.tsbuildinfo package", + "verify": "npm pack && tar xf *example-graphql*.tgz && tree package && npm run clean", + "lint": "npm run prettier:check && npm run eslint", + "lint:fix": "npm run eslint:fix && npm run prettier:fix", + "prettier:cli": "lb-prettier \"**/*.ts\" \"**/*.js\"", + "prettier:check": "npm run prettier:cli -- -l", + "prettier:fix": "npm run prettier:cli -- --write", + "eslint": "lb-eslint --report-unused-disable-directives .", + "eslint:fix": "npm run eslint -- --fix", + "pretest": "npm run clean && npm run build", + "test": "lb-mocha \"dist/__tests__/**/*.js\"", + "test:dev": "lb-mocha dist/__tests__/**/*.js && npm run posttest", + "prestart": "npm run build", + "start": "node ." + }, + "repository": { + "type": "git", + "url": "https://github.com/strongloop/loopback-next.git", + "directory": "examples/graphql" + }, + "author": "IBM Corp.", + "license": "MIT", + "files": [ + "README.md", + "dist", + "src", + "!*/__tests__" + ], + "dependencies": { + "@loopback/graphql": "^0.0.1", + "@loopback/boot": "^2.4.0", + "@loopback/core": "^2.9.2", + "@loopback/repository": "^2.10.0", + "@loopback/rest": "^5.2.1", + "tslib": "^2.0.0", + "class-transformer": "^0.2.3" + }, + "devDependencies": { + "@loopback/build": "^6.1.1", + "@loopback/eslint-config": "^8.0.4", + "@loopback/testlab": "^3.2.1", + "@types/multer": "^1.4.3", + "@types/node": "^10.17.27", + "eslint": "^7.5.0", + "typescript": "~3.9.7", + "rimraf": "^3.0.2", + "source-map-support": "^0.5.19" + }, + "copyright.owner": "IBM Corp." +} diff --git a/extensions/graphql/src/__examples__/graphql-test/public/index.html b/examples/graphql/public/index.html similarity index 100% rename from extensions/graphql/src/__examples__/graphql-test/public/index.html rename to examples/graphql/public/index.html diff --git a/extensions/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts b/examples/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts similarity index 68% rename from extensions/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts rename to examples/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts index 864acf79d8a3..1a0e21e80680 100644 --- a/extensions/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts +++ b/examples/graphql/src/__tests__/acceptance/graphql-middleware.acceptance.ts @@ -1,14 +1,14 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {createRestAppClient, givenHttpServerConfig} from '@loopback/testlab'; -import {GraphqlTestApplication} from '../../__examples__/graphql-test/src'; +import {GraphqlDemoApplication} from '../../'; import {runTests} from './graphql-tests'; describe('GraphQL middleware', () => { - let app: GraphqlTestApplication; + let app: GraphqlDemoApplication; before(giveAppWithGraphQLMiddleware); after(stopApp); @@ -16,7 +16,7 @@ describe('GraphQL middleware', () => { runTests(() => createRestAppClient(app)); async function giveAppWithGraphQLMiddleware() { - app = new GraphqlTestApplication({rest: givenHttpServerConfig()}); + app = new GraphqlDemoApplication({rest: givenHttpServerConfig()}); await app.boot(); await app.start(); return app; diff --git a/extensions/graphql/src/__tests__/acceptance/graphql-tests.ts b/examples/graphql/src/__tests__/acceptance/graphql-tests.ts similarity index 97% rename from extensions/graphql/src/__tests__/acceptance/graphql-tests.ts rename to examples/graphql/src/__tests__/acceptance/graphql-tests.ts index 5859bc3967a5..b76446ff4daa 100644 --- a/extensions/graphql/src/__tests__/acceptance/graphql-tests.ts +++ b/examples/graphql/src/__tests__/acceptance/graphql-tests.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/extensions/graphql/src/__tests__/acceptance/graphql.acceptance.ts b/examples/graphql/src/__tests__/acceptance/graphql.acceptance.ts similarity index 77% rename from extensions/graphql/src/__tests__/acceptance/graphql.acceptance.ts rename to examples/graphql/src/__tests__/acceptance/graphql.acceptance.ts index 46e489214d86..d7c064da3ce4 100644 --- a/extensions/graphql/src/__tests__/acceptance/graphql.acceptance.ts +++ b/examples/graphql/src/__tests__/acceptance/graphql.acceptance.ts @@ -1,16 +1,16 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {Application, createBindingFromClass} from '@loopback/core'; +import {GraphQLServer} from '@loopback/graphql'; import {supertest} from '@loopback/testlab'; -import {GraphQLServer} from '../..'; -import {RecipesDataSource} from '../../__examples__/graphql-test/src/datasources'; -import {RecipeResolver} from '../../__examples__/graphql-test/src/graphql-resolvers/recipe-resolver'; -import {RecipeRepository} from '../../__examples__/graphql-test/src/repositories'; -import {sampleRecipes} from '../../__examples__/graphql-test/src/sample-recipes'; -import {RecipeService} from '../../__examples__/graphql-test/src/services/recipe.service'; +import {RecipesDataSource} from '../../datasources'; +import {RecipeResolver} from '../../graphql-resolvers/recipe-resolver'; +import {RecipeRepository} from '../../repositories'; +import {sampleRecipes} from '../../sample-recipes'; +import {RecipeService} from '../../services/recipe.service'; import {runTests} from './graphql-tests'; describe('GraphQL server', () => { diff --git a/extensions/graphql/src/__examples__/graphql-test/src/application.ts b/examples/graphql/src/application.ts similarity index 85% rename from extensions/graphql/src/__examples__/graphql-test/src/application.ts rename to examples/graphql/src/application.ts index 8586f0e04eb0..642592e39708 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/application.ts +++ b/examples/graphql/src/application.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT @@ -8,12 +8,12 @@ import {ApplicationConfig} from '@loopback/core'; import {RepositoryMixin} from '@loopback/repository'; import {RestApplication} from '@loopback/rest'; import path from 'path'; -import {GraphQLBindings, GraphQLComponent} from '../../..'; +import {GraphQLBindings, GraphQLComponent} from '@loopback/graphql'; import {sampleRecipes} from './sample-recipes'; export {ApplicationConfig}; -export class GraphqlTestApplication extends BootMixin( +export class GraphqlDemoApplication extends BootMixin( RepositoryMixin(RestApplication), ) { constructor(options: ApplicationConfig = {}) { diff --git a/extensions/graphql/src/__examples__/graphql-test/src/datasources/README.md b/examples/graphql/src/datasources/README.md similarity index 100% rename from extensions/graphql/src/__examples__/graphql-test/src/datasources/README.md rename to examples/graphql/src/datasources/README.md diff --git a/extensions/graphql/src/__examples__/graphql-test/src/datasources/index.ts b/examples/graphql/src/datasources/index.ts similarity index 62% rename from extensions/graphql/src/__examples__/graphql-test/src/datasources/index.ts rename to examples/graphql/src/datasources/index.ts index 958b02588ef2..402e424025ee 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/datasources/index.ts +++ b/examples/graphql/src/datasources/index.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/extensions/graphql/src/__examples__/graphql-test/src/datasources/recipes.datasource.ts b/examples/graphql/src/datasources/recipes.datasource.ts similarity index 92% rename from extensions/graphql/src/__examples__/graphql-test/src/datasources/recipes.datasource.ts rename to examples/graphql/src/datasources/recipes.datasource.ts index 0a7561e6834b..33d644e6af66 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/datasources/recipes.datasource.ts +++ b/examples/graphql/src/datasources/recipes.datasource.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/extensions/graphql/src/__examples__/graphql-test/src/graphql-resolvers/recipe-resolver.ts b/examples/graphql/src/graphql-resolvers/recipe-resolver.ts similarity index 91% rename from extensions/graphql/src/__examples__/graphql-test/src/graphql-resolvers/recipe-resolver.ts rename to examples/graphql/src/graphql-resolvers/recipe-resolver.ts index 93f9e992a679..4d4b15614aa9 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/graphql-resolvers/recipe-resolver.ts +++ b/examples/graphql/src/graphql-resolvers/recipe-resolver.ts @@ -1,11 +1,9 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {service} from '@loopback/core'; -import {repository} from '@loopback/repository'; -import {ResolverInterface} from 'type-graphql'; import { arg, fieldResolver, @@ -13,8 +11,10 @@ import { mutation, query, resolver, + ResolverInterface, root, -} from '../../../..'; +} from '@loopback/graphql'; +import {repository} from '@loopback/repository'; import {RecipeInput} from '../graphql-types/recipe-input'; import {Recipe} from '../graphql-types/recipe-type'; import {RecipeRepository} from '../repositories'; diff --git a/extensions/graphql/src/__examples__/graphql-test/src/graphql-types/recipe-input.ts b/examples/graphql/src/graphql-types/recipe-input.ts similarity index 71% rename from extensions/graphql/src/__examples__/graphql-test/src/graphql-types/recipe-input.ts rename to examples/graphql/src/graphql-types/recipe-input.ts index 7383555d1def..0299c3a9d17b 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/graphql-types/recipe-input.ts +++ b/examples/graphql/src/graphql-types/recipe-input.ts @@ -1,9 +1,9 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {field, inputType} from '../../../..'; +import {field, inputType} from '@loopback/graphql'; import {Recipe} from './recipe-type'; @inputType() diff --git a/extensions/graphql/src/__examples__/graphql-test/src/graphql-types/recipe-type.ts b/examples/graphql/src/graphql-types/recipe-type.ts similarity index 89% rename from extensions/graphql/src/__examples__/graphql-test/src/graphql-types/recipe-type.ts rename to examples/graphql/src/graphql-types/recipe-type.ts index 433ab52a2581..324fca444478 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/graphql-types/recipe-type.ts +++ b/examples/graphql/src/graphql-types/recipe-type.ts @@ -1,10 +1,10 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT +import {field, Float, ID, Int, objectType} from '@loopback/graphql'; import {Entity, model, property} from '@loopback/repository'; -import {field, Float, ID, Int, objectType} from '../../../..'; @objectType({description: 'Object representing cooking recipe'}) @model({settings: {strict: false}}) diff --git a/extensions/graphql/src/__examples__/graphql-test/src/index.ts b/examples/graphql/src/index.ts similarity index 85% rename from extensions/graphql/src/__examples__/graphql-test/src/index.ts rename to examples/graphql/src/index.ts index 28b14d6f3215..06d5e9a4f49e 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/index.ts +++ b/examples/graphql/src/index.ts @@ -1,14 +1,14 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {ApplicationConfig, GraphqlTestApplication} from './application'; +import {ApplicationConfig, GraphqlDemoApplication} from './application'; export * from './application'; export async function main(options: ApplicationConfig = {}) { - const app = new GraphqlTestApplication(options); + const app = new GraphqlDemoApplication(options); await app.boot(); await app.start(); diff --git a/extensions/graphql/src/__examples__/graphql-test/src/migrate.ts b/examples/graphql/src/migrate.ts similarity index 78% rename from extensions/graphql/src/__examples__/graphql-test/src/migrate.ts rename to examples/graphql/src/migrate.ts index c36e0076549c..89d11f30f9cb 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/migrate.ts +++ b/examples/graphql/src/migrate.ts @@ -1,15 +1,15 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {GraphqlTestApplication} from './application'; +import {GraphqlDemoApplication} from './application'; export async function migrate(args: string[]) { const existingSchema = args.includes('--rebuild') ? 'drop' : 'alter'; console.log('Migrating schemas (%s existing schema)', existingSchema); - const app = new GraphqlTestApplication(); + const app = new GraphqlDemoApplication(); await app.boot(); await app.migrateSchema({existingSchema}); diff --git a/extensions/graphql/src/__examples__/graphql-test/src/repositories/README.md b/examples/graphql/src/repositories/README.md similarity index 100% rename from extensions/graphql/src/__examples__/graphql-test/src/repositories/README.md rename to examples/graphql/src/repositories/README.md diff --git a/extensions/graphql/src/__examples__/graphql-test/src/repositories/index.ts b/examples/graphql/src/repositories/index.ts similarity index 62% rename from extensions/graphql/src/__examples__/graphql-test/src/repositories/index.ts rename to examples/graphql/src/repositories/index.ts index 31ee1c20dc58..4e2ba225fc04 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/repositories/index.ts +++ b/examples/graphql/src/repositories/index.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/extensions/graphql/src/__examples__/graphql-test/src/repositories/recipe.repository.ts b/examples/graphql/src/repositories/recipe.repository.ts similarity index 95% rename from extensions/graphql/src/__examples__/graphql-test/src/repositories/recipe.repository.ts rename to examples/graphql/src/repositories/recipe.repository.ts index 24c6b053241f..065f279ff126 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/repositories/recipe.repository.ts +++ b/examples/graphql/src/repositories/recipe.repository.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/extensions/graphql/src/__examples__/graphql-test/src/sample-recipes.ts b/examples/graphql/src/sample-recipes.ts similarity index 90% rename from extensions/graphql/src/__examples__/graphql-test/src/sample-recipes.ts rename to examples/graphql/src/sample-recipes.ts index 83d4dc70de02..c694f432efe1 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/sample-recipes.ts +++ b/examples/graphql/src/sample-recipes.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/extensions/graphql/src/__examples__/graphql-test/src/services/recipe.service.ts b/examples/graphql/src/services/recipe.service.ts similarity index 81% rename from extensions/graphql/src/__examples__/graphql-test/src/services/recipe.service.ts rename to examples/graphql/src/services/recipe.service.ts index a774b24539ef..dae4dd320f23 100644 --- a/extensions/graphql/src/__examples__/graphql-test/src/services/recipe.service.ts +++ b/examples/graphql/src/services/recipe.service.ts @@ -1,5 +1,5 @@ -// Copyright IBM Corp. 2019. All Rights Reserved. -// Node module: @loopback/graphql +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-graphql // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/examples/graphql/tsconfig.json b/examples/graphql/tsconfig.json new file mode 100644 index 000000000000..3cf8d35e2d82 --- /dev/null +++ b/examples/graphql/tsconfig.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "extends": "@loopback/build/config/tsconfig.common.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src", + "composite": true + }, + "include": [ + "src/**/*", + "src/**/*.json" + ], + "references": [ + { + "path": "../../extensions/graphql/tsconfig.json" + }, + { + "path": "../../packages/boot/tsconfig.json" + }, + { + "path": "../../packages/core/tsconfig.json" + }, + { + "path": "../../packages/repository/tsconfig.json" + }, + { + "path": "../../packages/rest/tsconfig.json" + }, + { + "path": "../../packages/testlab/tsconfig.json" + } + ] +} diff --git a/extensions/graphql/README.md b/extensions/graphql/README.md index 2b25d58f54be..06c3beca9981 100644 --- a/extensions/graphql/README.md +++ b/extensions/graphql/README.md @@ -20,6 +20,9 @@ npm install --save @loopback/graphql ## Basic Use +Let's assume we build an application to expose GraphQL endpoints similar as +[@loopback/example-graphql](https://github.com/strongloop/loopback-next/tree/master/examples/graphql). + ```ts export class MyApplication extends BootMixin(RestApplication) { constructor(config: ApplicationConfig) { @@ -58,7 +61,7 @@ import {RestApplication} from '@loopback/rest'; import {ApplicationConfig} from '@loopback/core'; import {GraphQLComponent, GraphQLBindings} from '@loopback/graphql'; -export class GraphqlTestApplication extends BootMixin( +export class GraphqlDemoApplication extends BootMixin( RepositoryMixin(RestApplication), ) { constructor(options: ApplicationConfig = {}) { @@ -264,56 +267,8 @@ resolver classes from `src/graphql-resolvers` during `app.boot()`. ## Try it out -```sh -npm run demo -``` - -You should see the following messages: - -```sh -Server is running at http://[::1]:3000 -Try http://[::1]:3000/graphql -``` - -Open http://127.0.0.1:3000/graphql in your browser to play with the GraphiQL. - -![graphql-demo](graphql-demo.png) - -1. Copy the query to the right panel: - -```graphql -query GetRecipe1 { - recipe(recipeId: "1") { - title - description - ratings - creationDate - ratingsCount(minRate: 2) - averageRating - ingredients - numberInCollection - } -} -``` - -2. Click on the run icon: - -```json -{ - "data": { - "recipe": { - "title": "Recipe 1", - "description": "Desc 1", - "ratings": [0, 3, 1], - "creationDate": "2018-04-11T00:00:00.000Z", - "ratingsCount": 1, - "averageRating": 1.3333333333333333, - "ingredients": ["one", "two", "three"], - "numberInCollection": 1 - } - } -} -``` +Check out +[@loopback/example-graphql](https://github.com/strongloop/loopback-next/tree/master/examples/graphql). ## Contributions diff --git a/extensions/graphql/package-lock.json b/extensions/graphql/package-lock.json index 0ed3ed2d21c0..1a73677b9084 100644 --- a/extensions/graphql/package-lock.json +++ b/extensions/graphql/package-lock.json @@ -1,6 +1,6 @@ { "name": "@loopback/graphql", - "version": "0.1.0", + "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -103,9 +103,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -119,9 +119,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -134,9 +134,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -157,9 +157,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -178,9 +178,9 @@ "dev": true }, "@types/express": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.4.tgz", - "integrity": "sha512-DO1L53rGqIDUEvOjJKmbMEQ5Z+BM2cIEPy/eV3En+s166Gz+FeuzRerxcab757u/U4v4XF4RYrZPmqKa+aY/2w==", + "version": "4.17.7", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.7.tgz", + "integrity": "sha512-dCOT5lcmV/uC2J9k0rPafATeeyz+99xTt54ReX11/LObZgfzJqZNcW27zGhYyX+9iSEGXGt5qLPwRSvBZcLvtQ==", "requires": { "@types/body-parser": "*", "@types/express-serve-static-core": "*", @@ -189,9 +189,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.8", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.8.tgz", - "integrity": "sha512-1SJZ+R3Q/7mLkOD9ewCBDYD2k0WyZQtWYqF/2VvoNN2/uhI49J9CDN4OAm+wGMA0DbArA4ef27xl4+JwMtGggw==", + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.9.tgz", + "integrity": "sha512-DG0BYg6yO+ePW+XoDENYz8zhNGC3jDDEpComMYn7WJc4mY1Us8Rw9ax2YhJXxpyk2SF47PQAoQ0YyVT1a0bEkA==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -199,9 +199,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -214,9 +214,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -283,9 +283,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -303,9 +303,9 @@ "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, "@types/mime": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.2.tgz", - "integrity": "sha512-4kPlzbljFcsttWEq6aBW0OZe6BDajAmyvr2xknBG92tejQnvdGtT9+kXSZ580DqpxY9qG2xeQVF9Dq0ymUTo5Q==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz", + "integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==" }, "@types/minimatch": { "version": "3.0.3", @@ -313,9 +313,9 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/node": { - "version": "10.17.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.27.tgz", - "integrity": "sha512-J0oqm9ZfAXaPdwNXMMgAhylw5fhmXkToJd06vuDUSAgEDZ/n/69/69UmyBZbc+zT34UnShuDSBqvim3SPnozJg==" + "version": "10.17.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz", + "integrity": "sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ==" }, "@types/node-fetch": { "version": "2.5.7", @@ -327,16 +327,16 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, "@types/qs": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-7s9EQWupR1fTc2pSMtXRQ9w9gLOcrJn+h7HOXw4evxyvVqMi4f+q7d2tnFe3ng3SNHjtK+0EzGMGFUQX4/AQRA==" + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ==" }, "@types/range-parser": { "version": "1.2.3", @@ -369,9 +369,9 @@ }, "dependencies": { "@types/node": { - "version": "14.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.19.tgz", - "integrity": "sha512-yf3BP/NIXF37BjrK5klu//asUWitOEoUP5xE1mhSUjazotwJ/eJDgEmMQNlOeWOVv72j24QQ+3bqXHE++CFGag==" + "version": "14.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz", + "integrity": "sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA==" } } }, @@ -411,12 +411,12 @@ } }, "apollo-engine-reporting": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/apollo-engine-reporting/-/apollo-engine-reporting-2.2.1.tgz", - "integrity": "sha512-HPwf70p4VbxKEagHYWTwldqfYNekBE33BXcryHI9owxMm5B8/vutQfx67+4Bf351kOpndCG9I91aOiFBfC2/iQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/apollo-engine-reporting/-/apollo-engine-reporting-2.3.0.tgz", + "integrity": "sha512-SbcPLFuUZcRqDEZ6mSs8uHM9Ftr8yyt2IEu0JA8c3LNBmYXSLM7MHqFe80SVcosYSTBgtMz8mLJO8orhYoSYZw==", "requires": { "apollo-engine-reporting-protobuf": "^0.5.2", - "apollo-graphql": "^0.4.0", + "apollo-graphql": "^0.5.0", "apollo-server-caching": "^0.5.2", "apollo-server-env": "^2.4.5", "apollo-server-errors": "^2.4.2", @@ -446,9 +446,9 @@ } }, "apollo-graphql": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/apollo-graphql/-/apollo-graphql-0.4.5.tgz", - "integrity": "sha512-0qa7UOoq7E71kBYE7idi6mNQhHLVdMEDInWk6TNw3KsSWZE2/I68gARP84Mj+paFTO5NYuw1Dht66PVX76Cc2w==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/apollo-graphql/-/apollo-graphql-0.5.0.tgz", + "integrity": "sha512-YSdF/BKPbsnQpxWpmCE53pBJX44aaoif31Y22I/qKpB6ZSGzYijV5YBoCL5Q15H2oA/v/02Oazh9lbp4ek3eig==", "requires": { "apollo-env": "^0.6.5", "lodash.sortby": "^4.7.0" @@ -474,9 +474,9 @@ } }, "apollo-server-core": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.15.1.tgz", - "integrity": "sha512-ZRSK3uVPS6YkIV3brm2CjzVphg6NHY0PRhFojZD8BjoQlGo3+pPRP1IHFDvC3UzybGWfyCelcfF4YiVqh4GJHw==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.16.1.tgz", + "integrity": "sha512-nuwn5ZBbmzPwDetb3FgiFFJlNK7ZBFg8kis/raymrjd3eBGdNcOyMTJDl6J9673X9Xqp+dXQmFYDW/G3G8S1YA==", "requires": { "@apollographql/apollo-tools": "^0.4.3", "@apollographql/graphql-playground-html": "1.6.26", @@ -484,7 +484,7 @@ "@types/ws": "^7.0.0", "apollo-cache-control": "^0.11.1", "apollo-datasource": "^0.7.2", - "apollo-engine-reporting": "^2.2.1", + "apollo-engine-reporting": "^2.3.0", "apollo-server-caching": "^0.5.2", "apollo-server-env": "^2.4.5", "apollo-server-errors": "^2.4.2", @@ -517,17 +517,17 @@ "integrity": "sha512-FeGxW3Batn6sUtX3OVVUm7o56EgjxDlmgpTLNyWcLb0j6P8mw9oLNyAm3B+deHA4KNdNHO5BmHS2g1SJYjqPCQ==" }, "apollo-server-express": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.15.1.tgz", - "integrity": "sha512-anNb9HJo+KTpgvUqiPOjEl4wPq8y8NmWaIUz/QqPZlhIEDdf7wd/kQo3Sdbov++7J9JNJx6Ownnvw+wxfogUgA==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.16.1.tgz", + "integrity": "sha512-Oq5YNcaMYnRk6jDmA9LWf8oSd2KHDVe7jQ4wtooAvG9FVUD+FaFBgSkytXHMvtifQh2wdF07Ri8uDLMz6IQjTw==", "requires": { "@apollographql/graphql-playground-html": "1.6.26", "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.0", "@types/cors": "^2.8.4", - "@types/express": "4.17.4", + "@types/express": "4.17.7", "accepts": "^1.3.5", - "apollo-server-core": "^2.15.1", + "apollo-server-core": "^2.16.1", "apollo-server-types": "^0.5.1", "body-parser": "^1.18.3", "cors": "^2.8.4", @@ -1024,9 +1024,9 @@ } }, "graphql-tag": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.3.tgz", - "integrity": "sha512-4FOv3ZKfA4WdOKJeHdz6B3F/vxBLSgmBcGeAFPf4n1F64ltJUvOOerNj0rsJxONQGdhUMynQIvd6LzB+1J5oKA==" + "version": "2.10.4", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.4.tgz", + "integrity": "sha512-O7vG5BT3w6Sotc26ybcvLKNTdfr4GfsIVMD+LdYqXCeJIYPRyp8BIsDOUtxw7S1PYvRw5vH3278J2EDezR6mfA==" }, "graphql-tools": { "version": "4.0.8", @@ -1483,9 +1483,9 @@ } }, "subscriptions-transport-ws": { - "version": "0.9.16", - "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.16.tgz", - "integrity": "sha512-pQdoU7nC+EpStXnCfh/+ho0zE0Z+ma+i7xvj7bkXKb1dvYHSZxgRPaU6spRP+Bjzow67c/rRDoix5RT0uU9omw==", + "version": "0.9.17", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.17.tgz", + "integrity": "sha512-hNHi2N80PBz4T0V0QhnnsMGvG3XDFDS9mS6BhZ3R12T6EBywC8d/uJscsga0cVO4DKtXCkCRrWm2sOYrbOdhEA==", "requires": { "backo2": "^1.0.2", "eventemitter3": "^3.1.0", @@ -1580,9 +1580,9 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.2.0.tgz", - "integrity": "sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" }, "vary": { "version": "1.1.2", @@ -1603,9 +1603,9 @@ } }, "xss": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.7.tgz", - "integrity": "sha512-A9v7tblGvxu8TWXQC9rlpW96a+LN1lyw6wyhpTmmGW+FwRMactchBR3ROKSi33UPCUcUHSu8s9YP6F+K3Mw//w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.8.tgz", + "integrity": "sha512-3MgPdaXV8rfQ/pNn16Eio6VXYPTkqwa0vc7GkiymmY/DqR1SE/7VPAAVZz1GJsJFrllMYO3RHfEaiUGjab6TNw==", "requires": { "commander": "^2.20.3", "cssfilter": "0.0.10" diff --git a/extensions/graphql/package.json b/extensions/graphql/package.json index 8b08c980500d..b3d038a07de4 100644 --- a/extensions/graphql/package.json +++ b/extensions/graphql/package.json @@ -1,9 +1,9 @@ { "name": "@loopback/graphql", - "version": "0.1.0", + "version": "0.0.1", "description": "LoopBack's graphql integration", "engines": { - "node": ">=10" + "node": ">=10.16" }, "main": "dist/index.js", "types": "dist/index.d.ts", @@ -15,7 +15,6 @@ "integration": "lb-mocha \"dist/__tests__/integration/**/*.js\"", "test": "lb-mocha \"dist/__tests__/**/*.js\"", "unit": "lb-mocha \"dist/__tests__/unit/**/*.js\"", - "demo": "npm run build && node dist/__examples__/graphql-test/src/index.js", "verify": "npm pack && tar xf loopback-graphql*.tgz && tree package && npm run clean" }, "author": "IBM Corp.", @@ -27,7 +26,7 @@ "@loopback/http-server": "^2.1.10", "@loopback/metadata": "^2.2.3", "@types/graphql": "^14.5.0", - "apollo-server-express": "^2.14.1", + "apollo-server-express": "^2.16.1", "debug": "^4.1.1", "express": "^4.17.1", "graphql": "^15.3.0", diff --git a/extensions/graphql/src/__examples__/graphql-test/package.json b/extensions/graphql/src/__examples__/graphql-test/package.json deleted file mode 100644 index b7e34cf7fb1f..000000000000 --- a/extensions/graphql/src/__examples__/graphql-test/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "graphql-test", - "version": "1.0.0", - "description": "GraphQL Test Application", - "keywords": [ - "loopback-application", - "loopback" - ], - "main": "types/index.d.ts", - "engines": { - "node": ">=10.16" - }, - "scripts": { - "build": "tsc", - "build:watch": "tsc --watch", - "clean": "rimraf dist *.tsbuildinfo .eslintcache", - "pretest": "npm run clean && npm run build", - "migrate": "node ./dist/migrate", - "start": "npm run build && node -r source-map-support/register .", - "prepare": "npm run build" - }, - "repository": { - "type": "git" - }, - "author": "", - "license": "MIT", - "files": [ - "README.md", - "dist", - "src", - "!*/__tests__" - ], - "dependencies": { - "@loopback/boot": "^2.3.5", - "@loopback/core": "^2.9.1", - "@loopback/repository": "^2.9.0", - "@loopback/rest": "^5.2.0", - "@loopback/rest-explorer": "^2.2.6", - "tslib": "^2.0.0" - }, - "devDependencies": { - "rimraf": "^3.0.2", - "source-map-support": "^0.5.19", - "@loopback/testlab": "^3.2.0", - "@types/node": "^10.17.26", - "typescript": "~3.9.5" - }, - "copyright.owner": "IBM Corp." -} diff --git a/tsconfig.json b/tsconfig.json index 803111292bb2..ba60b330e74c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,6 +34,9 @@ { "path": "examples/file-transfer/tsconfig.json" }, + { + "path": "examples/graphql/tsconfig.json" + }, { "path": "examples/greeter-extension/tsconfig.json" },