Skip to content
Open
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 gateway.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ import { defineConfig } from "@graphql-hive/gateway";

export const gatewayConfig = defineConfig({
supergraph: "./supergraph.graphql",
globalObjectIdentification: true,
});
2,810 changes: 1,794 additions & 1,016 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
"@apollo/subgraph": "^2.10.0",
"fastify": "^5.2.1",
"mercurius": "16.1.0",
"@graphql-hive/gateway": "^1.12.2",
"@graphql-hive/gateway": "1.15.3-alpha-68b99cb7ad78bf7b63d22349fa79c1a749751114",
"@graphql-mesh/compose-cli": "^1.4.9",
"@graphql-tools/federation": "3.3.0-alpha-68b99cb7ad78bf7b63d22349fa79c1a749751114",
"@graphql-tools/schema": "^10.0.23",
"@graphql-tools/utils": "^10.8.6",
"@theguild/federation-composition": "^0.14.5",
Expand All @@ -60,5 +62,6 @@
"relay-runtime": "^14.1.0",
"express": "^4.18.2",
"sharp": "^0.33.2"
}
},
"packageManager": "[email protected]+sha256.c17d3797fb9a9115bf375e31bfd30058cac6bc9c3b8807a3d8cb2094794b51ca"
}
8 changes: 6 additions & 2 deletions relay.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"src": "./src",
"schema": "./supergraph.graphql",
"language": "typescript"
"schema": "./schema.graphql",
"language": "typescript",
"schemaConfig": {
"nodeInterfaceIdField": "nodeId",
"nodeInterfaceIdVariableName": "nodeId"
}
}
154 changes: 154 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
schema {
query: Query
mutation: Mutation
}

type Query {
viewer: Viewer
topStory(category: Category): Story
topStories: [Story]
"""Fetches an object given its globally unique `ID`."""
node(
"""The globally unique `ID`."""
nodeId: ID!
): Node
}

type Mutation {
likeStory(id: ID!, doesLike: Boolean!): StoryMutationResponse
postStoryComment(id: ID!, text: String!): StoryCommentMutationResponse
}

type Person implements Actor & Node {
id: ID!
name: String
email: String
profilePicture: Image
joined: String
location: Location
"""
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
"""
nodeId: ID!
}

type Image {
url(height: Int, width: Int): String!
altText: String
}

type Location {
id: ID!
name: String!
}

type Organization implements Actor & Node {
id: ID!
name: String
profilePicture: Image
joined: String
organizationKind: OrganizationKind
"""
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
"""
nodeId: ID!
}

type Story implements Node {
id: ID!
createdAt: String!
category: Category
title: String!
summary: String
updatedAt: String
attachments: [Image]
poster: Actor!
thumbnail: Image
likeCount: Int
doesViewerLike: Boolean
comments(first: Int, after: String): CommentsConnection
"""
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
"""
nodeId: ID!
}

type CommentsConnection {
edges: [CommentsConnectionEdge]
pageInfo: PageInfo
}

type CommentsConnectionEdge {
node: Comment
cursor: String
}

type Comment {
id: ID!
text: String
}

type PageInfo {
startCursor: String
endCursor: String
lastCursor: String
hasNextPage: Boolean
hasPreviousPage: Boolean
}

type Viewer {
actor: Actor
contacts(search: String): [Actor]
newsfeedStories(first: Int, after: String, category: Category): StoriesConnection
}

type StoriesConnection {
edges: [StoriesConnectionEdge]
pageInfo: PageInfo
}

type StoriesConnectionEdge {
node: Story
cursor: String
}

type StoryMutationResponse {
story: Story
}

type StoryCommentMutationResponse {
story: Story
commentEdge: CommentsConnectionEdge
}

interface Actor implements Node {
id: ID!
name: String
profilePicture: Image
joined: String
"""
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
"""
nodeId: ID!
}

enum OrganizationKind {
COMMERCIAL
NONPROFIT
GOVERNMENT
JOURNALISTIC
}

enum Category {
ALL
EDUCATION
NEWS
COOKING
}

interface Node {
"""
A globally unique identifier. Can be used in various places throughout the system to identify this single value.
"""
nodeId: ID!
}
Loading