-
I'm trying to follow the docs to setup the plugin. I haven't tried anything in concrete, I was just testing and debugging to see what I'll need to do. I can't use the plugin because when I try to set a scope on a resolver I receive the following error: Error
Here's my builder
import SchemaBuilder from '@giraphql/core'
import ValidationPlugin from '@giraphql/plugin-validation'
import ScopeAuthPlugin from '@giraphql/plugin-scope-auth'
const builder = new SchemaBuilder<{
DefaultInputFieldRequiredness: true
Scalars: {
Date: {
Input: Date
Output: Date | null
}
}
AuthScopes: {
public: boolean
}
}>({
defaultInputFieldRequiredness: true,
plugins: [ScopeAuthPlugin, ValidationPlugin],
authScopes: async (context) => {
console.log('CONTEXT:')
console.log(context)
return {
public: true,
}
},
})
builder.queryType({})
builder.mutationType({})
builder.scalarType('Date', {
serialize: (date) => date.toISOString(),
parseValue: (date: string) => {
return new Date(date)
},
})
export default builder Here's where I'm trying to use
builder.mutationField('createPost', (t) =>
t.field({
type: TopicPostObject,
args: {
input: t.arg({ type: createPostInput }),
},
authScopes: {
public: true, // ERROR HERE
},
resolve: ... Am I doing something wrong? Am I missing something? Version that I'm using: "@giraphql/core": "^2.15.1",
"@giraphql/plugin-scope-auth": "^2.10.1",
"@giraphql/plugin-validation": "^2.10.1", Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
hayes
Sep 21, 2021
Replies: 1 comment 1 reply
-
Do you have strict mode enabled? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
wfelipe99
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you have strict mode enabled?