populationgenomics / metamist

Sample level metadata system
MIT License
1 stars 1 forks source link

Query fails in strange way when query returns nothing #743

Closed vivbak closed 4 months ago

vivbak commented 4 months ago

A query like this

GET_ANALYSES_QUERY = gql(
    """
        query AnalysesQuery($metamist_proj: String!, $analysis_type: String!, $analysis_status: AnalysisStatus!) {
            project(name: $metamist_proj) {
                analyses (active: {eq: true}, type: {eq: $analysis_type}, status: {eq: $analysis_status}) {
                    id
                    type
                    meta
                    output
                    status
                    sequencingGroups {
                        id
                    }
                }
            }
        }
        """,
)

(As seen in production pipelines)

Fails, with a strange error

`raise TransportQueryError(
gql.transport.exceptions.TransportQueryError: {'message': '(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \')\' at line 3")', 'locations': [{'line': 3, 'column': 5}], 'path': ['project', 'analyses']} ` 

The query should return nothing. When I populated the data s.t. the query should return something it stopped failing as above.

A failure in general is no big deal, but this isn't very graceful and is hard to catch explicitly.