This is the starter-code for our rails take-home assessment. This project includes the following data models:
| Model | Description |
|---|---|
User |
Users using the platform |
NatureCode |
Categories describing the nature of a 911 call |
Chatroom |
Chatrooms where users can send messages back and forth |
ChatMessage |
Chat messages sent into chatrooms |
This project has also been set up with GraphQL.
-
All requests will go through the
POST /graphqlroute -
You can test the graphql operations by visiting
/graphiql. You can use tools like GraphiQL or Postman, orcURL
User authentication is handled by passing the user's email in the X-Email request header.
For this take-home assignment, you'll be asked to do the following:
Create the following GraphQL operations:
-
createChatroom($label: String!, $natureCodeId: ID)- Creates a new
Chatroomwith a label and optionally aNatureCode
- Creates a new
-
updateChatroom($id: ID!, $label: String, $natureCodeId: ID)- Updates an existing
Chatroom's label and/orNatureCode
- Updates an existing
-
resolveChatroom($id: ID!)- Sets an existing
Chatroom'sresolvedflag totrue
- Sets an existing
createChatMessage($chatroomId: ID!, message: String!, $authorId: ID!)- Creates a
ChatMessagein an existingChatroomwith amessageand aUseras theauthor
- Creates a
chatMessages($search: String, $authorId: ID)- Searches for
ChatMessages where themessagecontains the value of$search, and where the author matches the given$authorId
- Searches for
Create a model, or a set of models, that represent an audit trail. These new models should allow us to:
-
Include timestamps for actions performed
-
See all GraphQL queries performed, including the
Userand the query variables -
See all GraphQL mutations performed, including the
Userand the mutation variables
It is up to you to decide how those models are created and how the audit trail will be populated.
auditTrail($userId: ID)- Returns all actions tracked through the audit trail, optionally filtered by the given
$userId
- Returns all actions tracked through the audit trail, optionally filtered by the given