Skip to content

Counter displaying warning sign even if data was fetched correctly #212

Description

@GabrielMusatMestre

Describe the bug

A Counter component is not displaying the value even if the underlying GraphQL query succeeded and returned actual data.

To reproduce Steps to reproduce the behavior:

Create a counter component that queries directly to a DataPool:

function App() {
  return (
    <AccessTokenProvider fetchToken={fetchToken}>
      <Counter
        style={{ width: 100, height: 100 }}
        query={{
          metric: {
            count: {
              dataPool: { id: import.meta.env.VITE_DATA_POOL_ID }
            }
          }
        }}
      />
    </AccessTokenProvider>
  )
}

In this case the underlying GraphQL requests returned:

{"data":{"counter":{"value":"12"}}}

But this how the React application looks like:

Screenshot 2024-04-11 at 12 36 47

If I remove the query prop in the Counter component and I instead pass a static value, it works as expected.

Desktop (please complete the following information)

  • OS: macOS
  • Browser: Chrome
  • UI Kit Version: 0.5.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions