Skip to content

Commit

Permalink
Merge pull request #2649 from redorb/patch-1
Browse files Browse the repository at this point in the history
ra-data-graphql-simple: Fix filter id applied incorrectly to get many ref
  • Loading branch information
Gildas Garcia authored Apr 15, 2019
2 parents 164e258 + 6606cca commit 99960f8
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 @@ -243,9 +243,8 @@ export default introspectionResults => (

case GET_MANY_REFERENCE: {
const parts = preparedParams.target.split('.');

return {
filter: { [parts[0]]: { id: preparedParams.id } },
filter: { [`${parts[0]}Id`]: preparedParams.id },
};
}

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 99960f8

Please sign in to comment.