feat: add getCurrentUser query
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
140734b32c
commit
b8fb84ef42
7
packages/backend/src/graphql/queries/get-current-user.ts
Normal file
7
packages/backend/src/graphql/queries/get-current-user.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import Context from '../../types/express/context';
|
||||
|
||||
const getCurrentUser = async (_parent: unknown, _params: unknown, context: Context) => {
|
||||
return context.currentUser;
|
||||
};
|
||||
|
||||
export default getCurrentUser;
|
@@ -9,6 +9,7 @@ import getStepWithTestExecutions from './queries/get-step-with-test-executions';
|
||||
import getExecutions from './queries/get-executions';
|
||||
import getExecutionSteps from './queries/get-execution-steps';
|
||||
import getData from './queries/get-data';
|
||||
import getCurrentUser from './queries/get-current-user';
|
||||
|
||||
const queryResolvers = {
|
||||
getApps,
|
||||
@@ -22,6 +23,7 @@ const queryResolvers = {
|
||||
getExecutions,
|
||||
getExecutionSteps,
|
||||
getData,
|
||||
getCurrentUser,
|
||||
};
|
||||
|
||||
export default queryResolvers;
|
||||
|
@@ -14,6 +14,7 @@ type Query {
|
||||
offset: Int!
|
||||
): ExecutionStepConnection
|
||||
getData(stepId: String!, key: String!): JSONObject
|
||||
getCurrentUser: User
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
Reference in New Issue
Block a user