refactor: remove whole graphql implementation

This commit is contained in:
Ali BARIN
2024-09-26 13:29:46 +00:00
parent a043a044ca
commit 0b7591edce
28 changed files with 28 additions and 1181 deletions

View File

@@ -1,4 +1,3 @@
import { rule, shield } from 'graphql-shield';
import User from '../models/user.js';
import AccessToken from '../models/access-token.js';
@@ -47,19 +46,3 @@ export const authenticateUser = async (request, response, next) => {
return response.status(401).end();
}
};
const isAuthenticatedRule = rule()(isAuthenticated);
export const authenticationRules = {
Mutation: {
'*': isAuthenticatedRule,
},
};
const authenticationOptions = {
allowExternalErrors: true,
};
const authentication = shield(authenticationRules, authenticationOptions);
export default authentication;