building-envelope-data / api

API specification to exchange data about building envelopes
MIT License
3 stars 1 forks source link

Implement filter for `dataFormatId` #257

Closed christoph-maurer closed 2 years ago

christoph-maurer commented 2 years ago

Dear @StephenCzarnecki , do you think you can implement a filter for dataFormatId? Then @simon-wacker could implement it in the metabase frontend.

simon-wacker commented 2 years ago

I'll propose a minor update to the database GraphQL schema that will also change how filtering for dataFormatId works soon. If you plan to support filtering by dataFormatId please wait for that minor update.

simon-wacker commented 2 years ago

*DataPropositionInputs now have a property resources of type GetHttpsResourcesPropositionInput with the properties all, none, and some, each of type GetHttpsResourcePropositionInput with the properties dataFormatId and archivedFilesMetaInformation, where the latter is again a list proposition with the properties all, none, and some, each of type FileMetaInformationPropositionInput with the property dataFormatId.

For two example queries see https://github.com/ise621/building-envelope-data/blob/develop/queries/database/allData.graphql#L74-L92

For all changes see https://github.com/ise621/building-envelope-data/pull/260/commits/24949aa8576753fa8c721ffadb1389e7c7ccbfe5 and https://github.com/ise621/building-envelope-data/commit/26cb5e257ee79d119a473c7f0a59e5bb4887cd8a

RDmitchell commented 2 years ago

Priority = 3

christoph-maurer commented 2 years ago

I used the query

query {
  allOpticalData(
    where: {
      resources: {
        some: {
          dataFormatId: { equalTo: "e021cf20-e887-4dce-ad27-35da70cec472" }
        }
      }
    }
  ) {
    nodes {
      componentId
      resourceTree {
        root {
          value {
            locator
            dataFormatId
          }
        }
      }
    }
  }
}

to check the results and the response looks good.

@simon-wacker Can you please implement the filter for dataFormatId in the metabase frontend?

simon-wacker commented 2 years ago

Implemented in https://github.com/building-envelope-data/metabase/commit/cc40ba788e55690bff86ef5cf77e8631a2bc5114 (not yet deployed though).