System Information
- Strapi Version: 3.3.4
- Operating System: Ubuntu WSL / Docker
- Database: postgres 12
- Node Version: v14.15.0
- NPM Version: 6.14.9
- Yarn Version: /
Hi!
Hope someone can help me here, I am slowly going insane…
I’m trying to exclude the autogenerated GraphQL endpoints for plugins. Specifically, users, roles and files - so that my end-users wouldn’t be able to even see that they exist.
I don’t need them and they are a blocker to integrating the API into my Hasura setup, because they collide with my own schema.
I’ve gone and updated the schema files (/extensions/users-permissions/config/schema.graphql.js
and /extensions/upload/config/schema.graphql.js
), setting all existing resolvers for Query
and Mutation
to false
.
However, that works ONLY for those resolvers that have not been defined under the mutation
or query
key in their respective plugin’s schema (so, under node_modules/strapi-plugin-users-permissions/config/schema.graphql.js
and node_modules/strapi-plugin-upload/config/schema.graphql.js
).
The following resolvers do not go away, however I try to override them:
(on users-permissions plugin schema)
query: `
me: UsersPermissionsMe
`,
mutation: `
login(input: UsersPermissionsLoginInput!): UsersPermissionsLoginPayload!
register(input: UsersPermissionsRegisterInput!): UsersPermissionsLoginPayload!
forgotPassword(email: String!): UserPermissionsPasswordPayload
resetPassword(password: String!, passwordConfirmation: String!, code: String!): UsersPermissionsLoginPayload
emailConfirmation(confirmation: String!): UsersPermissionsLoginPayload
`,
(on upload plugin schema)
mutation: `
upload(refId: ID, ref: String, field: String, source: String, file: Upload!): UploadFile!
multipleUpload(refId: ID, ref: String, field: String, source: String, files: [Upload]!): [UploadFile]!
updateFileInfo(id: ID!, info: FileInfoInput!): UploadFile!
`,
Even if I override them, as on the example of the “upload” plugin…
module.exports = {
resolver: {
Query: {
files: false,
filesConnection: false
},
Mutation: {
createFile: false,
updateFile: false,
upload: false,
multipleUpload: false,
updateFileInfo: false,
deleteFile: false
}
}
};
…the GraphQL Schema still contains the three mutations upload
, multipleUpload
& updateFileInfo
.
I have just not found any way to get rid of them.
It seems I can only extend, but not remove anything that has been defined under mutation
or query
within the plugin modules.
Is that correct? Is it desired behavior?
I’m open for any hack to deactivate the plugin GraphQL, but keep the autogenerated API for my own custom Content Types…
Have tried overwriting the files from my Dockerfile after running yarn install, but that seems to be “too late” - the schema is generated regardless, including these queries & mutations…
Thank you for your help!
Greatly appreciated