1.1 KiB
1.1 KiB
Adding a new endpoint
- Create a new
<endpoint>API
class in api.- Make sure to correctly add the appropriate JSON and GraphQL annotations.
Look at other classes for examples. - NOTE: If anything returned could be null, make sure to instead provide an appropriate zero-value property,
otherwise GraphQL will choke.
See PluginAPI::new for an example.
- Make sure to correctly add the appropriate JSON and GraphQL annotations.
- Add a method to return the needed data to IProvider.
- Add a new REST endpoint to the Web::start method.
- Add a new GraphQL method to GraphQL
- Make sure to correctly add the appropriate GraphQL annotation.
- Modify both ServerAPI and MockProvider to fulfill the IProvider interface.
Testing
ServerRunner should start up the API using MockProvider.
If possible, a real test on a running Minecraft server would ideal!