Skip to content

Commit

Permalink
fix: graphQL access
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Jan 2, 2021
1 parent 709cc9c commit 4d871c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/graphql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import buildLocaleInputType from './schema/buildLocaleInputType';
import buildFallbackLocaleInputType from './schema/buildFallbackLocaleInputType';
import initCollections from '../collections/graphql/init';
import initGlobals from '../globals/graphql/init';
import { GraphQLResolvers } from './bindResolvers';
import buildWhereInputType from './schema/buildWhereInputType';
import access from '../auth/graphql/resolvers/access';
import { Config } from '../config/types';

type GraphQLTypes = {
Expand All @@ -26,6 +26,10 @@ class InitializeGraphQL {

config: Config;

graphQL: {
resolvers: GraphQLResolvers
};

Query: { name: string; fields: { [key: string]: any } } = { name: 'Query', fields: {} };

Mutation: { name: string; fields: { [key: string]: any } } = { name: 'Mutation', fields: {} };
Expand Down Expand Up @@ -90,7 +94,7 @@ class InitializeGraphQL {

this.Query.fields.Access = {
type: this.buildPoliciesType(),
resolve: access,
resolve: this.graphQL.resolvers.collections.auth.access,
};

if (typeof this.config.graphQL.queries === 'function') {
Expand Down

0 comments on commit 4d871c2

Please sign in to comment.