This repository was archived by the owner on Dec 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -261,10 +261,10 @@ export const printFieldLikeType = (
261261
262262 if ( field . type . isArray ) {
263263 rendering = array ( rendering , { innerUnion : false } )
264- }
265264
266- if ( ! field . type . isArrayRequired ) {
267- rendering = nullable ( rendering )
265+ if ( ! field . type . isArrayRequired ) {
266+ rendering = nullable ( rendering )
267+ }
268268 }
269269
270270 // We do not have to handle defaults becuase graphql only
Original file line number Diff line number Diff line change 11type Query {
22 media (first : Int ): [Media ]
3+ mediaItem (id : Int ! ): Media
34}
45
56interface Unused {
Original file line number Diff line number Diff line change @@ -350,6 +350,10 @@ export namespace QueryResolvers {
350350 first?: number | null;
351351 }
352352
353+ export interface ArgsMediaItem {
354+ id: number;
355+ }
356+
353357 export type MediaResolver = (
354358 parent: undefined,
355359 args: ArgsMedia,
@@ -360,6 +364,13 @@ export namespace QueryResolvers {
360364 | null
361365 | Promise<Array<Image | Video | null> | null>;
362366
367+ export type MediaItemResolver = (
368+ parent: undefined,
369+ args: ArgsMediaItem,
370+ ctx: Context,
371+ info: GraphQLResolveInfo
372+ ) => Image | Video | null | Promise<Image | Video | null>;
373+
363374 export interface Type {
364375 media: (
365376 parent: undefined,
@@ -370,6 +381,13 @@ export namespace QueryResolvers {
370381 | Array<Image | Video | null>
371382 | null
372383 | Promise<Array<Image | Video | null> | null>;
384+
385+ mediaItem: (
386+ parent: undefined,
387+ args: ArgsMediaItem,
388+ ctx: Context,
389+ info: GraphQLResolveInfo
390+ ) => Image | Video | null | Promise<Image | Video | null>;
373391 }
374392}
375393
@@ -615,6 +633,9 @@ export const Query: QueryResolvers.Type = {
615633 ...QueryResolvers.defaultResolvers,
616634 media: (parent, args, ctx) => {
617635 throw new Error(\\"Resolver not implemented\\");
636+ },
637+ mediaItem: (parent, args, ctx) => {
638+ throw new Error(\\"Resolver not implemented\\");
618639 }
619640};
620641",
You can’t perform that action at this time.
0 commit comments