To start your Phoenix server:
- Run
mix setup
to install and setup dependencies - Run
mix ecto.create
to create DB - Run
mix ecto.reset
to seed database - Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Visit: https://localhost:4000/api/graphiql
query{
conversations(userId: 1) {
id
user_1{
username
}
user_2{
username
}
}
}
query{
users{
id
username
}
}
query{
conversations(userId: 1) {
id
user_1{
username
}
user_2{
username
}
}
}
mutation{
createConversation(user_1_id: 1, user_2_id: 2) {
id
}
}
mutation {
createMessage(user_id: 1, conversation_id: 1, body: "This is new!"){
id
}
}
- Graphiql wants to use camel case for mutations but they won't work if I don't use snake case...
- No auth or checking so you can create a message for any conversation even if you're not part of it