Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lh/corrections #1

Merged
merged 3 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'