Skip to content

Commit

Permalink
update for optimization and bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jhk482001 committed Feb 10, 2025
1 parent 06793bf commit 677c1e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/graphql/models/Badge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GraphQLObjectType, GraphQLString } from 'graphql';
import { GraphQLObjectType, GraphQLString, GraphQLNonNull, GraphQLList } from 'graphql';

Check failure on line 1 in src/graphql/models/Badge.js

View workflow job for this annotation

GitHub Actions / install-and-test

Replace `·GraphQLObjectType,·GraphQLString,·GraphQLNonNull,·GraphQLList·` with `⏎··GraphQLObjectType,⏎··GraphQLString,⏎··GraphQLNonNull,⏎··GraphQLList,⏎`

Check failure on line 1 in src/graphql/models/Badge.js

View workflow job for this annotation

GitHub Actions / install-and-test

Replace `·GraphQLObjectType,·GraphQLString,·GraphQLNonNull,·GraphQLList·` with `⏎··GraphQLObjectType,⏎··GraphQLString,⏎··GraphQLNonNull,⏎··GraphQLList,⏎`

export default new GraphQLObjectType({
name: 'Badge',
Expand Down
6 changes: 4 additions & 2 deletions src/graphql/models/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import AvatarTypeEnum from './AvatarTypeEnum';
import Contribution from './Contribution';
import Node from '../interfaces/Node';
import { timeRangeInput, createConnectionType } from 'graphql/util';
import Badge from './UserAwardedBadge';
import UserAwardedBadge from './UserAwardedBadge';

/**
* Field config helper for current user only field.
Expand Down Expand Up @@ -161,7 +161,9 @@ const User = new GraphQLObjectType({
},

badges: {
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(UserAwardedBadge))),
type: new GraphQLNonNull(
new GraphQLList(new GraphQLNonNull(UserAwardedBadge))
),
description: 'Badges awarded to the user.',
resolve: (user) => user.badges || [],
},
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/models/UserAwardedBadge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GraphQLBoolean, GraphQLObjectType, GraphQLString } from 'graphql';
import { GraphQLBoolean, GraphQLObjectType, GraphQLString, GraphQLNonNull } from 'graphql';

Check failure on line 1 in src/graphql/models/UserAwardedBadge.js

View workflow job for this annotation

GitHub Actions / install-and-test

Replace `·GraphQLBoolean,·GraphQLObjectType,·GraphQLString,·GraphQLNonNull·` with `⏎··GraphQLBoolean,⏎··GraphQLObjectType,⏎··GraphQLString,⏎··GraphQLNonNull,⏎`

Check failure on line 1 in src/graphql/models/UserAwardedBadge.js

View workflow job for this annotation

GitHub Actions / install-and-test

Replace `·GraphQLBoolean,·GraphQLObjectType,·GraphQLString,·GraphQLNonNull·` with `⏎··GraphQLBoolean,⏎··GraphQLObjectType,⏎··GraphQLString,⏎··GraphQLNonNull,⏎`

export default new GraphQLObjectType({
name: 'UserAwardedBadge',
Expand Down

0 comments on commit 677c1e2

Please sign in to comment.