Refactor GraphqlPerson to GraphqlQueryPerson

A GraphqlQueryPerson has an id which is used in mutations.
This commit is contained in:
Anders Borch
2023-04-24 21:43:28 +02:00
parent b6c7149b66
commit 8ed09d61ef
5 changed files with 18 additions and 11 deletions

View File

@ -12,6 +12,7 @@ describe('mapPerson', () => {
created_at: '',
company: {
__typename: '',
id: 1,
company_name: '',
company_domain: '',
},

View File

@ -14,10 +14,11 @@ export type Person = {
countryCode: string;
};
export type GraphqlPerson = {
export type GraphqlQueryPerson = {
city: string;
company: {
__typename: string;
id: number;
company_name: string;
company_domain: string;
};
@ -48,7 +49,7 @@ export const mapPerson = (person: GraphqlQueryPerson): Person => ({
pipe: { name: 'coucou', id: 1, icon: '💰' },
...person,
company: {
id: 1,
id: person.company.id,
name: person.company.company_name,
domain: person.company.company_domain,
},