@easy-cms/plugin-graphql 0.47.3 → 0.47.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -340,7 +340,7 @@ import { printSchema } from "graphql";
340
340
  // src/info.ts
341
341
  var INFO = {
342
342
  name: "@easy-cms/plugin-graphql",
343
- ...true ? { version: "0.47.3" } : {}
343
+ ...true ? { version: "0.47.4" } : {}
344
344
  };
345
345
 
346
346
  // src/schema.ts
@@ -909,9 +909,10 @@ var Builder = class {
909
909
  ...typeof args.fallbackLocale === "boolean" ? { fallbackLocale: args.fallbackLocale } : {}
910
910
  };
911
911
  }
912
- /** What a query asked for: drafts only for logged-in users and API keys, as in REST. */
912
+ /** What a query asked for: drafts only for staff and API keys, as in REST. */
913
913
  readOf(args, ctx) {
914
- return { ...this.localeOf(args), ...args.draft === true && ctx.user ? { draft: true } : {} };
914
+ const staff = ctx.user !== null && ctx.user !== void 0 && ctx.user.member !== true;
915
+ return { ...this.localeOf(args), ...args.draft === true && staff ? { draft: true } : {} };
915
916
  }
916
917
  // ---- Filtering and sorting -----------------------------------------------------------------
917
918
  whereType(fields, name, drafts, root) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/plugin-graphql",
3
- "version": "0.47.3",
3
+ "version": "0.47.4",
4
4
  "description": "GraphQL API for Easy CMS: queries and mutations for every collection and global, with the same access rules as REST",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,11 +20,11 @@
20
20
  "graphql": "^16.11.0 || ^17.0.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@easy-cms/core": "^0.47.3"
23
+ "@easy-cms/core": "^0.47.4"
24
24
  },
25
25
  "devDependencies": {
26
- "@easy-cms/core": "^0.47.3",
27
- "@easy-cms/db-sqlite": "^0.47.3"
26
+ "@easy-cms/core": "^0.47.4",
27
+ "@easy-cms/db-sqlite": "^0.47.4"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=22.12"