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

Fatal Error: Call to undefined method WPGraphQL\Types::int() #3

Open
philipjohn opened this issue Jan 6, 2022 · 1 comment
Open

Comments

@philipjohn
Copy link

Upon activating and trying the query below I see this error in my PHP error logs:

PHP Fatal error: Uncaught Error: Call to undefined method WPGraphQL\Types::int() in /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/src/OffsetPaginationType.php:31

Here's the full stack trace:

Stack trace:
#0 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/src/OffsetPaginationType.php(19): Enshrined\OffsetPagination\OffsetPaginationType::fields()
#1 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/wp-graphql-offset-pagination.php(174): Enshrined\OffsetPagination\OffsetPaginationType->__construct()
#2 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/wp-graphql-offset-pagination.php(158): Enshrined\OffsetPagination::offset_pagination()
#3 /srv/www/lichfieldlive/public_html/wp-includes/class-wp-hook.php(305): Enshrined\OffsetPagination->add_input_fields()
#4 /srv/www/lichfieldlive/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters()
#5 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql/src/Type/ in /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/src/OffsetPaginationType.php on line 31

Here's my query, which I'm running through GraphiQL in the dashboard:

query GetPosts($tagIds: [ID], $catIds: [ID], $authorId: [ID], $searchTerm: String) {
  posts(
    where: {
      tagIn: $tagIds,
      categoryIn: $catIds,
      authorIn: $authorId,
      search: $searchTerm
      offsetPagination: {
        page: $page,
        per_page: $per_page
      }
    }
  ) {
    
    		node {
					databaseId
					featuredImage {
						node {
						altText
						sourceUrl(size: POST_THUMBNAIL)
						}
					}
					title
					uri
				}
			}
  }

Variables:

{
  "page":1,
  "per_page":10
}

I may have been looking in the wrong place but I'm not sure WPGraphQL\Types::int() exists in the WP-GraphQL plugin. This is with WP-GraphQL v1.6.10, so maybe it was removed at some point?

@brianpereradap
Copy link

Having the same issue. Is there a workaround for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants