Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGSDB returns only 100 optical data sets #327

Open
christoph-maurer opened this issue Jul 4, 2024 · 3 comments
Open

IGSDB returns only 100 optical data sets #327

christoph-maurer opened this issue Jul 4, 2024 · 3 comments
Assignees
Labels
ISE Fraunhofer Institute for Solar Energy Systems ISE LBNL Lawrence Berkeley National Laboratory

Comments

@christoph-maurer
Copy link
Member

@danielmcquillen When I query https://igsdb-v2.herokuapp.com/graphql/ with

{
  allOpticalData {
    edges {
      node {
        id
        uuid
        opticalDataId
        componentId
      }
    }
  }
}

I receive only 100 optical data sets. I have expected around 6800 optical data sets. Can IGSDB return all of them?

We need to implement planning software which uses IGSDB. I hope that it is easy to fix for you.

@christoph-maurer christoph-maurer added ISE Fraunhofer Institute for Solar Energy Systems ISE LBNL Lawrence Berkeley National Laboratory labels Jul 4, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in EQWIN-P Jul 4, 2024
@github-actions github-actions bot added the triage Review issue to make sure it is relevant, actionable, and has all the necessary information label Jul 4, 2024
@christoph-maurer christoph-maurer removed the triage Review issue to make sure it is relevant, actionable, and has all the necessary information label Jul 4, 2024
@christoph-maurer
Copy link
Member Author

When I query for data sets with a minimum visible transmittance of 0.8, I also receive the metadata of only 100 data sets although there are more in IGSDB.

{
  allOpticalData(
    where: {nearnormalHemisphericalVisibleTransmittances: {some: {greaterThanOrEqualTo: 0.8}}}
  ) {
    edges {
      node {
        componentId
        nearnormalHemisphericalVisibleTransmittances
      }
    }
  }
}

@danielmcquillen
Copy link
Collaborator

danielmcquillen commented Jul 4, 2024

@christoph-maurer The GraphQL endpoint is set up to use the Relay convention for paging. You need to include the pageInfo object...(more in the simple docs page I wrote: https://igsdb-v2.herokuapp.com/docs/help/using-api/graphql)

{
  allOpticalData(
    where: {nearnormalHemisphericalVisibleTransmittances: {some: {greaterThanOrEqualTo: 0.8}}}
  ) {
    edges {
      node {
        componentId
        nearnormalHemisphericalVisibleTransmittances
      }
    }
    pageInfo {
        hasNextPage
        startCursor
        endCursor
    }
  }
}

Which gives a pagination object in the results (at the bottom):

      "pageInfo": {
        "hasNextPage": true,
        "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
        "endCursor": "YXJyYXljb25uZWN0aW9uOjk5"
      }
    }

The problem we have is we're hosting on Heroku, which has a 30 second request timeout. If we try to return all results I think we sometimes exceed that limit and the response cuts out. However, I haven't tried recently so I guess I can set up the default query to try to return all results and we'll see what happens!

I'll look into this today or early next week, but in the meantime can you use the paging mechanism?

@christoph-maurer
Copy link
Member Author

@danielmcquillen Thanks for trying! The API specification allows pagination. When pagination is not requested, the metadata should be returned of all data sets which fulfil the where argument. Hopefully, Heroku can respond all data sets. Sure, in the meantime, I'll use the paging mechanism for manual examples with the other project partners.

@simon-wacker simon-wacker self-assigned this Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISE Fraunhofer Institute for Solar Energy Systems ISE LBNL Lawrence Berkeley National Laboratory
Projects
Status: 🆕 New
Development

No branches or pull requests

4 participants