As per title ;)
This commit is contained in:
Charles Bochet
2024-10-16 09:28:31 +02:00
committed by GitHub
parent 0a5bc02499
commit 4d0af3eb7e

View File

@ -62,23 +62,47 @@ export const graphqlMocks = {
}); });
}, },
), ),
graphql.query('FindManyViews', ({ variables }) => { graphql.query('SearchPeople', () => {
const objectMetadataId = variables.filter?.objectMetadataId?.eq;
const viewType = variables.filter?.type?.eq;
return HttpResponse.json({ return HttpResponse.json({
data: { data: {
views: { searchPeople: {
edges: mockedViewsData edges: peopleMock.slice(0, 3).map((person) => ({
.filter( node: person,
(view) => cursor: null,
view?.objectMetadataId === objectMetadataId && })),
view?.type === viewType, pageInfo: {
) hasNextPage: false,
.map((view) => ({ hasPreviousPage: false,
node: view, startCursor: null,
cursor: null, endCursor: null,
})), },
},
},
});
}),
graphql.query('SearchCompanies', () => {
return HttpResponse.json({
data: {
searchCompanies: {
edges: companiesMock.slice(0, 3).map((company) => ({
node: company,
cursor: null,
})),
pageInfo: {
hasNextPage: false,
hasPreviousPage: false,
startCursor: null,
endCursor: null,
},
},
},
});
}),
graphql.query('SearchOpportunities', () => {
return HttpResponse.json({
data: {
searchOpportunities: {
edges: [],
pageInfo: { pageInfo: {
hasNextPage: false, hasNextPage: false,
hasPreviousPage: false, hasPreviousPage: false,