Skip to content

Commit

Permalink
FIX Use consistent name for BaseElement graphql typename (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Aug 8, 2022
1 parent 6dee8b3 commit 54246f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,10 @@ public function EvenOdd()
*/
public static function getGraphQLTypeName(): string
{
return class_exists(StaticSchema::class)
? StaticSchema::inst()->typeNameForDataObject(static::class)
: str_replace('\\', '_', static::class);
// For GraphQL 3, use the static schema type name - except for BaseElement for which this is inconsistent.
if (class_exists(StaticSchema::class) && static::class !== self::class) {
return StaticSchema::inst()->typeNameForDataObject(static::class);
}
return str_replace('\\', '_', static::class);
}
}

0 comments on commit 54246f9

Please sign in to comment.