Skip to content

Commit d270acf

Browse files
authored
fix: retain @oneOf in public api (#6670)
1 parent ed66171 commit d270acf

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

packages/services/api/src/modules/shared/module.graphql.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
import { gql } from 'graphql-modules';
22

33
export default gql`
4-
scalar DateTime @tag(name: "public")
4+
"""
5+
A date-time string at UTC, such as \`2007-12-03T10:15:30Z\`, is compliant with the date-time format outlined
6+
in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
7+
8+
This scalar is a description of an exact instant on the timeline such as the instant that a user account was created.
9+
10+
This scalar ignores leap seconds (thereby assuming that a minute constitutes 59 seconds). In this respect, it diverges from the RFC 3339 profile.
11+
12+
Where an RFC 3339 compliant date-time string has a time-zone other than UTC, it is shifted to UTC. For example, the date-time string \`2016-01-01T14:10:20+01:00\` is shifted to \`2016-01-01T13:10:20Z\`.
13+
"""
14+
scalar DateTime
15+
@tag(name: "public")
16+
@specifiedBy(url: "https://the-guild.dev/graphql/scalars/docs/scalars/date-time")
517
scalar Date
618
scalar JSON
719
scalar JSONSchemaObject
820
scalar SafeInt
921
1022
extend schema
1123
@link(url: "https://specs.apollo.dev/link/v1.0")
12-
@link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@tag"])
24+
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@tag", "@composeDirective"])
25+
@link(url: "https://github.com/graphql/graphql-spec/pull/825/v0.1", import: ["@oneOf"])
26+
@composeDirective(name: "@oneOf")
27+
28+
directive @oneOf on INPUT_OBJECT
1329
1430
directive @link(url: String!, import: [String!]) repeatable on SCHEMA
31+
directive @composeDirective(name: String!) repeatable on SCHEMA
1532
1633
directive @tag(
1734
name: String!

packages/services/server/src/public-graphql-handler.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@ type CreatePublicGraphQLHandlerArgs = {
2626
tracing?: TracingInstance;
2727
};
2828

29+
const defaultQuery = `#
30+
# Welcome to the Hive Console GraphQL API.
31+
#
32+
`;
33+
2934
export const createPublicGraphQLHandler = (
3035
args: CreatePublicGraphQLHandlerArgs,
3136
): RouteHandlerMethod => {
3237
const publicSchema = createPublicGraphQLSchema<Context>(args.registry);
3338
const server = createYoga<Context>({
3439
logging: args.logger,
40+
graphiql: {
41+
title: 'Hive Console - GraphQL API',
42+
defaultQuery,
43+
},
3544
plugins: [
3645
useArmor(),
3746
useHiveSentry(),

0 commit comments

Comments
 (0)