Add workspace members (#536)

* Add workspace members

* Remove workspace provider

* Lint
This commit is contained in:
Emilien Chauvet
2023-07-07 18:56:22 -07:00
committed by GitHub
parent 66dcc9b2e1
commit c26a7fda9a
9 changed files with 212 additions and 1 deletions

View File

@ -2288,6 +2288,7 @@ export type Query = {
__typename?: 'Query';
clientConfig: ClientConfig;
currentUser: User;
currentWorkspace: Workspace;
findManyCommentThreads: Array<CommentThread>;
findManyCompany: Array<Company>;
findManyPerson: Array<Person>;
@ -3061,6 +3062,11 @@ export type UpdateUserMutationVariables = Exact<{
export type UpdateUserMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null } };
export type GetCurrentWorkspaceQueryVariables = Exact<{ [key: string]: never; }>;
export type GetCurrentWorkspaceQuery = { __typename?: 'Query', currentWorkspace: { __typename?: 'Workspace', id: string, workspaceMember?: Array<{ __typename?: 'WorkspaceMember', id: string, user: { __typename?: 'User', id: string, email: string, avatarUrl?: string | null, firstName?: string | null, lastName?: string | null } }> | null } };
export type UpdateWorkspaceMutationVariables = Exact<{
data: WorkspaceUpdateInput;
}>;
@ -4508,6 +4514,50 @@ export function useUpdateUserMutation(baseOptions?: Apollo.MutationHookOptions<U
export type UpdateUserMutationHookResult = ReturnType<typeof useUpdateUserMutation>;
export type UpdateUserMutationResult = Apollo.MutationResult<UpdateUserMutation>;
export type UpdateUserMutationOptions = Apollo.BaseMutationOptions<UpdateUserMutation, UpdateUserMutationVariables>;
export const GetCurrentWorkspaceDocument = gql`
query GetCurrentWorkspace {
currentWorkspace {
id
workspaceMember {
id
user {
id
email
avatarUrl
firstName
lastName
}
}
}
}
`;
/**
* __useGetCurrentWorkspaceQuery__
*
* To run a query within a React component, call `useGetCurrentWorkspaceQuery` and pass it any options that fit your needs.
* When your component renders, `useGetCurrentWorkspaceQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetCurrentWorkspaceQuery({
* variables: {
* },
* });
*/
export function useGetCurrentWorkspaceQuery(baseOptions?: Apollo.QueryHookOptions<GetCurrentWorkspaceQuery, GetCurrentWorkspaceQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetCurrentWorkspaceQuery, GetCurrentWorkspaceQueryVariables>(GetCurrentWorkspaceDocument, options);
}
export function useGetCurrentWorkspaceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCurrentWorkspaceQuery, GetCurrentWorkspaceQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetCurrentWorkspaceQuery, GetCurrentWorkspaceQueryVariables>(GetCurrentWorkspaceDocument, options);
}
export type GetCurrentWorkspaceQueryHookResult = ReturnType<typeof useGetCurrentWorkspaceQuery>;
export type GetCurrentWorkspaceLazyQueryHookResult = ReturnType<typeof useGetCurrentWorkspaceLazyQuery>;
export type GetCurrentWorkspaceQueryResult = Apollo.QueryResult<GetCurrentWorkspaceQuery, GetCurrentWorkspaceQueryVariables>;
export const UpdateWorkspaceDocument = gql`
mutation UpdateWorkspace($data: WorkspaceUpdateInput!) {
updateWorkspace(data: $data) {