I'm developing an app that uses Lighthouse GraphQL server for Laravel. It's generally great, but I've run into some weird behaviour.
When I run it locally, using Laravel Valet, it works perfectly. When I run it on staging server, it fails with Call to undefined relationship [venue] on model [App\\Event].
Event has one Venue and Venue can have many events.
When I use tinker on the server, it finds relationships fine.
Relationship on Event is setup like this
public function venue() : BelongsTo
{
return $this->belongsTo('App\Venue');
}
And relationship on Venue is
public function events() : HasMany
{
return $this->hasMany('App\Event', 'venue_id');
}
In schema.graphql relationship is defined as
type Event {
id: ID!
[...]
venue: Venue @belongsTo
}
And other relationships work fine. Same versions locally and on staging.
Any idea as to what is going on?