Skip to content

List Queries don't seem to work  #9

@akeemphilbert

Description

@akeemphilbert

I have it setup and when I try to query a specific item that seems to work:

query MyQuery {
  educationalStage (educationalStageId:1) {
    title
  }
}

and it returns the expected result

{
  "data": {
    "educationalStage": {
      "title": "Early Childhood"
    }
  }
}

but when I try to do the list query the total count is 0 which is odd because there are records there evidenced by my previous search

query MyQuery {
  educationalStages {
    totalCount
  }
}

result

{
  "data": {
    "educationalStages": {
      "totalCount": 0
    }
  }
}

Setup code (note I've tried without the plugins as well no dice, I've also tried without merging the other schema)

const { schema, plugin } =  await makeSchemaAndPlugin(
        pgPool,
        'public', // PostgreSQL schema to use
        {
            // watchPg: true,
            // graphiql: true,
            // enhanceGraphiql: true,
            subscriptions: true,
            retryOnInitFail: true,
            dynamicJson: true,
            setofFunctionsContainNulls: false,
            ignoreRBAC: false,
            ignoreIndexes: true,
            showErrorStack: true,
            extendedErrors: ['hint', 'detail', 'errcode'],
            appendPlugins: [require("@graphile-contrib/pg-many-to-many"),require("@graphile-contrib/pg-simplify-inflector")]
        }
    );


    const server = new ApolloServer({
        schema: mergeSchemas({schemas:[madeExecutableSchema,schema]}),
        playground: true,
        plugins: [plugin]
    });

dependencies

{
    "@graphile-contrib/pg-many-to-many": "^1.0.0",
    "@graphile-contrib/pg-simplify-inflector": "^6.0.0",
    "apollo-server-express": "^2.16.1",
    "body-parser": "^1.19.0",
    "elasticsearch": "^16.7.1",
    "express": "^4.17.1",
    "graphql": "^15.3.0",
    "graphql-tools": "^6.1.0",
    "pg": "^8.3.3",
    "postgraphile": "^4.8.0",
    "postgraphile-apollo-server": "^0.1.1"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions