View in #general on Slack
@Zach_Zoeller: Hello, I’m working through some of the React examples and most of them use a resultSet that has functions like seriesNames
, chartPivot
, tableColumns
, etc but my call to useCubeQuery
is giving me a resultSet object that is a different shape:
{
loadReponse: ...,
queryType: ...,
loadResponses: ...,
options: ...,
backwardCompatibleData: ...,
}
Any ideas on why I’m seeing this difference?
@Ryan_Woodring: do you mind sharing the code where you are using useCubeQuery
?
@Zach_Zoeller:
const { cubejsApi } = useCubeContext();
const { resultSet } = useCubeQuery({
measures: ['EmissionsSegmentRegion.loadCount'],
timeDimensions: [
{
dimension: 'EmissionsSegmentRegion.pickupDate',
},
],
order: {
'EmissionsSegmentRegion.loadCount': 'desc',
},
dimensions: ['EmissionsSegmentRegion.country'],
});
console.log('resultSet', resultSet);
@Ryan_Woodring: your code looks pretty much correct to me. have you tried accessing those members that you can’t see? remember that javascript “inheritance” works a bit differently than classical inheritance. The member methods really exist on the prototype:
also, do keep in mind that the ResultSet will be null until the results are returned asynchronously from the endpoint
@Zach_Zoeller: Thanks @Ryan_Woodring 
@Ryan_Woodring: cool. glad to help. took me a few minutes to figure out what was going on 'til i fired up a test instance i had lying around