stacker.news/api/resolvers/apiKey.js

8 lines
262 B
JavaScript

import { GraphQLError } from 'graphql'
export default function assertApiKeyNotPermitted ({ me }) {
if (me?.apiKey === true) {
throw new GraphQLError('this operation is not allowed to be performed via API Key', { extensions: { code: 'FORBIDDEN' } })
}
}