System Information
- Strapi Version: 4.5.1
- Operating System: Mac OS Monterey
- Database: postgres
- Node Version: 16.15.1
- NPM Version: 8.11.0
- Yarn Version: 1.22.17
I’m trying to use apollo federation with Strapi but I can’t compose the supergraph because our existing graphql schema already has login
, register
, and me
. I don’t need to include anything but our custom content types in the graphql schema but I can’t seem to remove the login features.
Considering that these features come from the user-permissions plugin (strapi/users-permissions.js at cf49ddbbfc33fa6a0145f9ddf50677e31c1d711e · strapi/strapi · GitHub)
It would make sense that if I disable that plugin for the graphql extension service it would remove them. Something like this
register({ strapi }) {
const extensionService = strapi.plugin('graphql').service('extension');
extensionService.shadowCRUD('plugin::users-permissions.permission').disable();
extensionService.shadowCRUD('plugin::users-permissions.role').disable();
extensionService.shadowCRUD('plugin::users-permissions.user').disable();
}
unfortunately throws a nexus error when trying to generate the schema
[2022-12-07 15:49:44.667] error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type, check the docs for extending types
Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type, check the docs for extending types
at extendError (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:1123:12)
at SchemaBuilder.addType (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:156:27)
at SchemaBuilder.missingType (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:704:14)
at SchemaBuilder.getOrBuildType (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:938:21)
at SchemaBuilder.getInputType (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:868:34)
at SchemaBuilder.buildArgs (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:850:64)
at SchemaBuilder.buildOutputField (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:799:24)
at /Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:770:43
at Array.forEach (<anonymous>)
at SchemaBuilder.buildOutputFields (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:769:16)
at fields (/Users/kyle/flymachine/fm-content-manager/node_modules/nexus/dist/builder.js:544:32)
at resolveThunk (/Users/kyle/flymachine/fm-content-manager/node_modules/graphql/type/definition.js:480:40)
at defineFieldMap (/Users/kyle/flymachine/fm-content-manager/node_modules/graphql/type/definition.js:692:18)
at GraphQLObjectType.getFields (/Users/kyle/flymachine/fm-content-manager/node_modules/graphql/type/definition.js:633:27)
at collectReferencedTypes (/Users/kyle/flymachine/fm-content-manager/node_modules/graphql/type/schema.js:366:81)
at new GraphQLSchema (/Users/kyle/flymachine/fm-content-manager/node_modules/graphql/type/schema.js:148:9)
trying to disable all queries or mutations with disableQueries
or disableMutations
only removes the queries like this:
usersPermissionsUser(id: ID): UsersPermissionsUserEntityResponse
Trying to target the uid in the link above with
extensionService.shadowCRUD('plugin::users-permissions.auth.register').disable();
Does anyone know how to disable these login features from the graphql api?