Skip to content

Commit

Permalink
fix: 🐛 create instance of class for nested entites (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazekD authored Feb 20, 2023
1 parent 13a0ac1 commit b6327b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-graphql-client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ function processResponseData(data, entityClasses) {
processedData[field] = value;
});

const type = data.__typename;
const type = processedData.__typename;
if (!type || !entityClasses[type]) {
return data;
return processedData;
}

return Reflect.construct(entityClasses[type], [data]);
return Reflect.construct(entityClasses[type], [processedData]);
}

function addTypenameToSelections(document) {
Expand Down

0 comments on commit b6327b0

Please sign in to comment.