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 getExecutions from './queries/get-executions';
|
||||||
import getExecutionSteps from './queries/get-execution-steps';
|
import getExecutionSteps from './queries/get-execution-steps';
|
||||||
import getData from './queries/get-data';
|
import getData from './queries/get-data';
|
||||||
|
import getCurrentUser from './queries/get-current-user';
|
||||||
|
|
||||||
const queryResolvers = {
|
const queryResolvers = {
|
||||||
getApps,
|
getApps,
|
||||||
@@ -22,6 +23,7 @@ const queryResolvers = {
|
|||||||
getExecutions,
|
getExecutions,
|
||||||
getExecutionSteps,
|
getExecutionSteps,
|
||||||
getData,
|
getData,
|
||||||
|
getCurrentUser,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default queryResolvers;
|
export default queryResolvers;
|
||||||
|
@@ -14,6 +14,7 @@ type Query {
|
|||||||
offset: Int!
|
offset: Int!
|
||||||
): ExecutionStepConnection
|
): ExecutionStepConnection
|
||||||
getData(stepId: String!, key: String!): JSONObject
|
getData(stepId: String!, key: String!): JSONObject
|
||||||
|
getCurrentUser: User
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mutation {
|
type Mutation {
|
||||||
|
Reference in New Issue
Block a user