diff --git a/backend/src/db/graphql/groups.js b/backend/src/db/graphql/groups.js index 788b889a3..bd6f5e721 100644 --- a/backend/src/db/graphql/groups.js +++ b/backend/src/db/graphql/groups.js @@ -42,7 +42,12 @@ export const createGroupMutation = gql` name icon } - # locationName # test this as result + locationName + location { + name + nameDE + nameEN + } myRole } } @@ -89,7 +94,12 @@ export const updateGroupMutation = gql` icon } # avatar # test this as result - # locationName # test this as result + locationName + location { + name + nameDE + nameEN + } myRole } } @@ -154,7 +164,12 @@ export const groupQuery = gql` avatar { url } - # locationName # test this as result + locationName + location { + name + nameDE + nameEN + } myRole } } diff --git a/backend/src/schema/resolvers/groups.spec.js b/backend/src/schema/resolvers/groups.spec.js index b4653edaf..3d94ffd93 100644 --- a/backend/src/schema/resolvers/groups.spec.js +++ b/backend/src/schema/resolvers/groups.spec.js @@ -277,7 +277,7 @@ describe('in mode', () => { groupType: 'public', actionRadius: 'regional', categoryIds, - // locationName, // test this as result + locationName: 'Hamburg, Germany', } }) @@ -304,6 +304,12 @@ describe('in mode', () => { description: 'Some description' + descriptionAdditional100, groupType: 'public', actionRadius: 'regional', + locationName: 'Hamburg, Germany', + location: expect.objectContaining({ + name: 'Hamburg', + nameDE: 'Hamburg', + nameEN: 'Hamburg', + }), }, }, errors: undefined, @@ -539,6 +545,7 @@ describe('in mode', () => { groupType: 'public', actionRadius: 'regional', categoryIds, + locationName: 'Hamburg, Germany', }, }) }) @@ -554,6 +561,12 @@ describe('in mode', () => { expect.objectContaining({ id: 'my-group', slug: 'the-best-group', + locationName: 'Hamburg, Germany', + location: expect.objectContaining({ + name: 'Hamburg', + nameDE: 'Hamburg', + nameEN: 'Hamburg', + }), myRole: 'owner', }), expect.objectContaining({ @@ -2642,6 +2655,7 @@ describe('in mode', () => { groupType: 'public', actionRadius: 'regional', categoryIds, + locationName: 'Hamburg, Germany', }, }) }) @@ -2663,7 +2677,7 @@ describe('in mode', () => { description: 'Some country relevant description' + descriptionAdditional100, actionRadius: 'national', // avatar, // test this as result - // locationName, // test this as result + locationName: 'Berlin, Germany', }, }), ).resolves.toMatchObject({ @@ -2676,7 +2690,12 @@ describe('in mode', () => { description: 'Some country relevant description' + descriptionAdditional100, actionRadius: 'national', // avatar, // test this as result - // locationName, // test this as result + locationName: 'Berlin, Germany', + location: expect.objectContaining({ + name: 'Berlin', + nameDE: 'Berlin', + nameEN: 'Berlin', + }), myRole: 'owner', }, }, diff --git a/webapp/graphql/Fragments.js b/webapp/graphql/Fragments.js index b67851873..68cd02c6a 100644 --- a/webapp/graphql/Fragments.js +++ b/webapp/graphql/Fragments.js @@ -12,6 +12,7 @@ export const userFragment = gql` deleted } ` + export const locationAndBadgesFragment = (lang) => gql` fragment locationAndBadges on User { location {