Skip to content

Commit

Permalink
Fix filter id applied incorrectly to get many ref
Browse files Browse the repository at this point in the history
Fixes issue #2571
  • Loading branch information
kenanwarren committed Dec 12, 2018
1 parent d81aede commit b218337
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/ra-data-graphql-simple/src/buildVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ export default introspectionResults => (
};
case GET_MANY_REFERENCE: {
const parts = params.target.split('.');

return {
filter: { [parts[0]]: { id: params.id } },
filter: { [`${parts[0]}Id`]: params.id },
};
}
case GET_ONE:
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-data-graphql-simple/src/buildVariables.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('buildVariables', () => {
{}
)
).toEqual({
filter: { author: { id: 'author1' } },
filter: { authorId: 'author1' },
});
});
});
Expand Down

0 comments on commit b218337

Please sign in to comment.