Anthony van Beek

When I try to expose the Block I get

  1. [Emergency] Uncaught InvalidArgumentException: Non-existent classname "Block"
  2. GET /dev/graphiql?flush=&flushtoken=c10866c8bd1bb1db96594852044f5aa2
  3. Line 73 in /app/vendor/silverstripe/graphql/src/Scaffolding/Traits/DataObjectTypeTrait.php
  4.  
  5. Source
  6. 64 * @return $this
  7. 65 */
  8. 66 public function setDataObjectClass($class)
  9. 67 {
  10. 68 if (!$class) {
  11. 69 throw new InvalidArgumentException("Missing class provided");
  12. 70 }
  13. 71
  14. 72 if (!class_exists($class)) {
  15. 73 throw new InvalidArgumentException("Non-existent classname \"{$class}\"");
  16. 74 }
  17. 75
  18. 76 if (!is_subclass_of($class, DataObject::class)) {
  19. 77 throw new InvalidArgumentException("\"{$class}\" is not a DataObject subclass");
  20. 78 }
  21. 79
chillu

The YAML example above isn’t using the fully qualified name of the DataObject - which would be something like DNADesign\Element\BaseElement (haven’t checked in code)

unclecheese

I'd recommend having your say in the GH thread posted above

unclecheese

FYI we're putting heaps of time into the way all these subtypes work, so just be aware that all of this is likely to break in 4.4.

Anthony van Beek

I got

  1. ImageBlock:
  2. fields: '*'
  3. operations:
  4. read: true
  5. readOne: true
unclecheese

cause you want read<HighestAncestor> to include all the subtypes