craftql icon indicating copy to clipboard operation
craftql copied to clipboard

User photoVolumeId incorrect

Open ManiakMill opened this issue 6 years ago • 5 comments

class User extends Schema System setting param should be photoVolumeId to photoVolumeUid

User photo field now not available

ManiakMill avatar Feb 13 '19 15:02 ManiakMill

Ah, thanks, this is a breaking change from Craft 3.1. Let me look at this and make sure I can support 3.0 and 3.1 with the same code or if I need some sort of branch.

markhuot avatar Feb 13 '19 15:02 markhuot

Craft CMS v. 3.1.9.1 Nice TY!

ManiakMill avatar Feb 13 '19 15:02 ManiakMill

I'm not able to recreate this. I can query user photos without issues. What query/mutation is causing the issue?

{
  users{
    id
    photo{
      url
    }
  }
}

markhuot avatar Feb 24 '19 17:02 markhuot

I ran into this one too, using Craft Pro 3.1.14.

Query:

{
  users {
    photo {
      url
    }
  }
}

Response:

{
  "errors": [
    {
      "message": "Cannot query field \"photo\" on type \"User\".",
      "category": "graphql",
      "locations": [
        {
          "line": 3,
          "column": 5
        }
      ]
    }
  ]
}

Adding the following after this line in the User type fixes it for me:

if (!$volumeId) {
  $volumeId = Craft::$app->getSystemSettings()->getSetting('users', 'photoVolumeUid');
}

andygott avatar Feb 25 '19 09:02 andygott

@markhuot Is this something that will be fixed in an upcoming release? The solution above is working, but I guess its only temporary until the plugin will be updated?

sjimster avatar Mar 26 '19 09:03 sjimster