GraphQL framework
A GraphQL framework is included in the runtime. This framework handles all incoming GraphQL requests.
When the GraphQL handler is added, a few files are automatically generated (see below for additional information). These files need to be modified with implementation specific data.
Node.js GraphQL framework
For Node.js, [NestJS](https://docs.nestjs.com/graphql/quick-start) is used as framework together with [Apollo Server](https://www.apollographql.com/docs/apollo-server/).
The GraphQL schema needs to be added to the _"src/assets/graphql/schema.graphql"_. It is also possible to add additional schema files.
The implementation should be added to the _"src/services/graphql.resolver.ts"_ class. Additional implementation classes can also be used by modifying the _"src/exports/graphql.exports.ts"_ file.
Java GraphQL framework
For Java, the [GraphQL Java](https://www.graphql-java.com/documentation/getting-started/) is used as framework.
The GraphQL schema needs to be added to the _"src/main/resources/graphql/schema.graphql"_. It is also possible to add additional schema files.
The implementation should be added to the _"src/main/.../services/GraphQLResolver.java"_ class. Additional implementation classes can also be used by modifying the _"src/main/resources/META-INF/services/com.infor.baas.commons.interfaces.GraphQLHandler"_ file.
Configuration
Normally, the GraphQL schema is included with the service as described above, but in some scenarios it can also be useful to be able to just update the schema without the need to redeploy the service. For this we can use a configuration in the manifest that looks like this:
```json
{
"name": "BAAS_GRAPHQL_SCHEMA",
"value": null,
"hidden": false,
"type": "file"
}
```
This allows for a user to upload a new schema through the Admin UI. The service automatically restarts after the upload, and the new schema is available. If no schema is available as a configuration, the built-in schema is used.