kandimat/redaktions-app/src/backend/mutations/userRole.ts

27 lines
644 B
TypeScript

import { gql } from "@apollo/client";
import { UppercaseUserRole } from "../../jwt/jwt";
import { BasicPersonFragment, BasicPersonResponse } from "../queries/person";
export const CHANGE_ROLE = gql`
mutation ChangeRole($personRowId: Int!, $newRole: Role!) {
changeRole(input: { personRowId: $personRowId, newRole: $newRole }) {
person {
...BasicPersonFragment
}
}
}
${BasicPersonFragment}
`;
export interface ChangeRoleVariables {
personRowId: number;
newRole: UppercaseUserRole;
}
export interface ChangeRoleResponse {
__typename: "Mutation";
changeRole: {
person?: BasicPersonResponse;
};
}