Chore: Use Fragments as types (#1670)
* Use Fragments as types Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Use Fragments as types in GraphQL queries and mutations Co-authored-by: v1b3m <vibenjamin6@gmail.com> --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com>
This commit is contained in:
19
front/src/modules/auth/graphql/fragments/authFragments.ts
Normal file
19
front/src/modules/auth/graphql/fragments/authFragments.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const AUTH_TOKEN = gql`
|
||||
fragment AuthTokenFragment on AuthToken {
|
||||
token
|
||||
expiresAt
|
||||
}
|
||||
`;
|
||||
|
||||
export const AUTH_TOKENS = gql`
|
||||
fragment AuthTokensFragment on AuthTokenPair {
|
||||
accessToken {
|
||||
...AuthTokenFragment
|
||||
}
|
||||
refreshToken {
|
||||
...AuthTokenFragment
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user