Skip to content

TypeError when using sort/filters on allWpTermNode #30586

@adel0559

Description

@adel0559

When querying a gatsby dev server (as in http://localhost:8000/__graphql when running gatsby develop) the server crashes if you query allWpTermNode with a filter or sort parameter. The error received looks as follows:

type.resolveType is not a function

  TypeError: type.resolveType is not a function
  
  - node-model.js:648 getFields
    [sitename]/[gatsby]/src/schema/node-model.js:648:29
  
  - node-model.js:661 resolveRecursive
    [sitename]/[gatsby]/src/schema/node-model.js:661:21
  
  - node-model.js:390 resolver
    [sitename]/[gatsby]/src/schema/node-model.js:390:38
  
  - nodes.ts:145 saveResolvedNodes
    [sitename]/[gatsby]/src/redux/nodes.ts:145:30
  
  - node-model.js:388 LocalNodeModel._doResolvePrepareNodesQueue
    [sitename]/[gatsby]/src/schema/node-model.js:388:13
  
  - node-model.js:351 
    [sitename]/[gatsby]/src/schema/node-model.js:351:22
  
  - task_queues.js:79 processTicksAndRejections
    internal/process/task_queues.js:79:11

Steps to reproduce

Query something like the following from a gatsby dev server connected to a wordpress site with some taxonomies added.

allWpTermNode(filter: {count: {gte: 1}}) {
    nodes {
      id
    }
  }

Expected result

The query return the expected terms.

Actual result

Server crashes with the error type.resolveType is not a function

Environment

gatsby: gatsby@next => 3.3.0-next.0
gatsby-background-image: latest => 1.5.0
gatsby-cli: latest => 3.1.0
gatsby-image: latest => 3.1.0
gatsby-plugin-breadcrumb: latest => 12.1.0
gatsby-plugin-compression-v2: latest => 0.1.0
gatsby-plugin-manifest: latest => 3.1.0
gatsby-plugin-offline: latest => 4.1.0
gatsby-plugin-postcss: latest => 4.1.0
gatsby-plugin-purgecss: latest => 6.0.0
gatsby-plugin-react-helmet: latest => 4.1.0
gatsby-plugin-s3: latest => 0.3.8
gatsby-plugin-sass: latest => 4.1.0
gatsby-plugin-sharp: latest => 3.1.2
gatsby-plugin-split-css: latest => 2.0.0
gatsby-plugin-typescript: latest => 3.1.0
gatsby-source-filesystem: latest => 3.1.0
gatsby-source-wordpress: latest => 5.1.0
gatsby-source-wordpress-menus: latest => 1.1.4
gatsby-transformer-sharp: latest => 3.1.0

npmGlobalPackages:
gatsby-cli: 3.0.0

Wordpress 5.7
wp-graphql 1.3.3
wp-gatsby 1.0.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugAn issue or pull request relating to a bug in Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions