So first off lighthouse v2 is awesome!!!! great work! It's so much more simple than v1. I'm currently working on upgrading a project to using lighthouse v2 and I'm getting stuck updating to Relay Modern, because it requires either the schema.graphql or schema.json file to compile the static files from, but it does not recognize the fields when you do things like this someFeild: [Type!]! @paginate(type:"relay" model: "SomeModel") because it does not know that translates to someFeild(first: Int! after: String):
So am I missing something obvious? Or is this something that's not currently supported?
The power of a single schema its awesome,
I think you mixing a query with a relationships,
What about the example project?
https://github.com/nuwave/lighthouse-example
Im also working on Relay Modern and all you need now its the introspection.
You can download GrahqQL Playground, just open the url of the endpoint and you will be able to see all queries, mutations, etc.

All you need to concentrate its on your .schema , you probably looking to do something like this:
type Car {
make: String!
year: Int!
# Set type pagination type to `cursor` and since the field doesn't match the name of the
# relationship, you can customize it with the `relation` argument
extras: [CarOption!]! @hasMany(type: "relay" relation: "options")
}
Use this trait for your models:
...
use Nuwave\Lighthouse\Support\Traits\IsRelayConnection;
class Car extends Model
{
use IsRelayConnection;
...
and declare your types on the .graphql files with something like (see @model and @globalID)
type Media @model {
id: ID! @globalId
thumb: String
list: String
featured: String
large: String
xlarge: String
}
Just another tip, on the React side with Relay Modern, im using commands like:
yarn db, this will download the schema from the given endpoint and after will do the local compilation using the generated schema.graphql.
// pacakage.json
"scripts": {
"db": "yarn schema && yarn relay",
"schema": "graphql get-schema -i -e dev",
"relay": "relay-compiler --src ./src --schema ./schema.graphql",
}
// .graphqlconfig
{
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"dev": {
"url": "http://appgestor.test/v1/graphql",
"method": "post"
},
"dev-auth": {
"url": "http://appgestor.test/api/graphql",
"method": "post"
},
"prod": {
"url": "https://XXX/v1/graphql",
"method": "post"
},
"prod-auth": {
"url": "https://XXX/api/graphql",
"method": "post"
}
}
}
}
@kikoseijo Thank you so much for your detailed explanation. This is soooo helpful and exactly what I was looking for. 馃憤
Most helpful comment
Just another tip, on the React side with Relay Modern, im using commands like:
yarn db, this will download the schema from the given endpoint and after will do the local compilation using the generatedschema.graphql.// pacakage.json
// .graphqlconfig