With these it helps The easiest way to do so is by enabling the "Unique" constraint for a certain field (studentNumber in your case for the Student model). You can enable constraints in the structure view when editing a model. Note: Under the hood, this creates a unique index in the database just like you suggested.
GraphCool Domain Model Design - ModifiedBy attribute giving trouble
By : kingInTheNorth
Date : March 29 2020, 07:55 AM
I wish this help you thanks for using Graphcool! First things first. As you point out Graphcool enforces two-way relations when you want to connect types. In some cases you know up front that you only want to query the data in one direction, so it might seem unintuitive that you have to create a two-way relation.
may help you . The best way to do this is by using the API Gateway pattern. The idea of that approach is to put a gateway server on top of Graphcool's CRUD API and thus customize the API. With this approach, you'd write an additional resolver function that retrieves the random element for you: