Skip to content

Commit

Permalink
Merge pull request #1 from apollographql-education/lh/corrections
Browse files Browse the repository at this point in the history
Lh/corrections
  • Loading branch information
lizhennessy authored Jan 2, 2025
2 parents 329e4d5 + c55c70f commit 3ffcb17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions messages/src/resolvers/Mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const Mutation: Resolvers = {
createConversation: async (_, { recipientId }, { dataSources, userId }) => {
return dataSources.db.createNewConversation({ userId, recipientId })
},
/* UNCOMMENT LINES 9-33 */
// sendMessage: async (_, { message }, { dataSources, userId }) => {
// const { conversationId, text } = message;
// const {
Expand Down
22 changes: 11 additions & 11 deletions messages/src/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@ extend schema
@link(url: "https://specs.apollo.dev/federation/v2.8", import: ["@key"])

type Query {
# Retrieve all conversations for the logged-in user
"Retrieve all conversations for the logged-in user"
conversations: [Conversation]
# Retrieves your conversation with a given recipient
"Retrieves your conversation with a given recipient"
conversation(recipientId: ID!): Conversation
}

type Mutation {
# Initiate a new conversation with a particular user
"Initiate a new conversation with a particular user"
createConversation(recipientId: ID!): Conversation
}

type Conversation {
id: ID!
# The messages belonging to the conversation
"The messages belonging to the conversation"
messages: [Message]
# The timestamp from when the conversation was created
"The timestamp from when the conversation was created"
createdAt: String!
}

type Message {
id: ID!
# The text content of the message
"The text content of the message"
text: String!
# The user that sent the message
"The user that sent the message"
sentFrom: User!
# The user the message was sent to
"The user the message was sent to"
sentTo: User!
# The timestamp of when the message was sent
"The timestamp of when the message was sent"
sentTime: String
}

input NewMessageInput {
# The text content of the message
"The text content of the message"
text: String!
# The ID of the conversation
"The ID of the conversation"
conversationId: String!
}

Expand Down
4 changes: 2 additions & 2 deletions router/router-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file dictates the settings the router should use when running
# This file specifies the settings the router should use when running
supergraph:
listen: 127.0.0.1:4000
include_subgraph_errors:
Expand All @@ -11,4 +11,4 @@ headers:
all:
request:
- propagate:
named: "Authorization"
named: 'Authorization'

0 comments on commit 3ffcb17

Please sign in to comment.