> For the complete documentation index, see [llms.txt](https://vincent-desmares.gitbook.io/graphql-sequelize-generator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vincent-desmares.gitbook.io/graphql-sequelize-generator/resolvers/default-usage.md).

# Default usage

Resolvers configurations are grouped into a single configuration property of **generateApolloServer** and **generateSchema.**

Here is the simplest example possible to define the "user" model:

```javascript
graphqlSchemaDeclaration.user = {
  model: models.user
}
```

Assuming  "models" is your import of the Sequelize models folder.

This will by default:

* Create a create "user" resolver to list all users
* Create the userCreate, userUpdate and userDelete resolvers for the related mutations
* Create a "count" resolver

### Relations between endpoints

Declaring many models will add the related models AND their associations to your GraphQL schema.

For example:

```javascript
graphqlSchemaDeclaration.user = {
  model: models.user
}
graphqlSchemaDeclaration.car = {
  model: models.car
}
graphqlSchemaDeclaration.house = {
  model: models.house
}
```

Will allow you to query:

```javascript
query test {
  user {
    id
    name
    house {
      id
      address
    }
    cars {
      id
      brand
    }
  }
}
```

If you have the relations set in your Sequelize folder.

{% hint style="warning" %}
Any relation linked to a model **NOT** defined in the **graphqlSchemaDeclaration** will **be ignored**. It's up to you to chose what do you expose.
{% endhint %}
