naystack 1.4.26 → 1.4.27

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.
@@ -694,7 +694,7 @@ function query(fn, options) {
694
694
  ...options,
695
695
  fn,
696
696
  authCall: getAuthCaller(fn),
697
- call: getCaller(fn)
697
+ call: options.authorized ? getAuthCaller(fn) : getCaller(fn)
698
698
  };
699
699
  }
700
700
  var getUserId = async () => {
@@ -690,7 +690,7 @@ function query(fn, options) {
690
690
  ...options,
691
691
  fn,
692
692
  authCall: getAuthCaller(fn),
693
- call: getCaller(fn)
693
+ call: options.authorized ? getAuthCaller(fn) : getCaller(fn)
694
694
  };
695
695
  }
696
696
  var getUserId = async () => {
@@ -116,7 +116,7 @@ function query(fn, options) {
116
116
  ...options,
117
117
  fn,
118
118
  authCall: getAuthCaller(fn),
119
- call: getCaller(fn)
119
+ call: options.authorized ? getAuthCaller(fn) : getCaller(fn)
120
120
  };
121
121
  }
122
122
  var getUserId = async () => {
@@ -25,7 +25,7 @@ interface BaseDefinition<T, U, IsAuth extends boolean = false, OutputNullable ex
25
25
  }
26
26
  interface QueryDefinition<T, U, IsAuth extends boolean = false, OutputNullable extends boolean = false, InputNullable extends boolean = false> extends BaseDefinition<T, U, IsAuth, OutputNullable, InputNullable> {
27
27
  fn: (ctx: IsAuth extends true ? AuthorizedContext : Context, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
28
- call: IsAuth extends true ? never : (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
28
+ call: (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
29
29
  authCall: (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
30
30
  mutation?: boolean;
31
31
  }
@@ -25,7 +25,7 @@ interface BaseDefinition<T, U, IsAuth extends boolean = false, OutputNullable ex
25
25
  }
26
26
  interface QueryDefinition<T, U, IsAuth extends boolean = false, OutputNullable extends boolean = false, InputNullable extends boolean = false> extends BaseDefinition<T, U, IsAuth, OutputNullable, InputNullable> {
27
27
  fn: (ctx: IsAuth extends true ? AuthorizedContext : Context, data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
28
- call: IsAuth extends true ? never : (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
28
+ call: (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
29
29
  authCall: (data: ParsedGQLTypeWithNullability<U, InputNullable, false>) => Promisify<ParsedGQLTypeWithNullability<T, OutputNullable, true>>;
30
30
  mutation?: boolean;
31
31
  }
@@ -101,7 +101,7 @@ function query(fn, options) {
101
101
  ...options,
102
102
  fn,
103
103
  authCall: getAuthCaller(fn),
104
- call: getCaller(fn)
104
+ call: options.authorized ? getAuthCaller(fn) : getCaller(fn)
105
105
  };
106
106
  }
107
107
  var getUserId = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naystack",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "description": "A stack built with Next + GraphQL + S3 + Auth",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",