chore: Use integer for IDs of resources

This commit is contained in:
Faruk AYDIN
2021-12-26 13:41:46 +03:00
committed by Ömer Faruk Aydın
parent a58411ee99
commit 3f2f1212c9
29 changed files with 172 additions and 103 deletions

View File

@@ -1,11 +1,11 @@
import { GraphQLString, GraphQLNonNull } from 'graphql';
import { GraphQLInt, GraphQLNonNull } from 'graphql';
import { GraphQLJSONObject } from 'graphql-type-json';
import Connection from '../../models/connection';
import connectionType from '../types/connection';
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = {
id: string,
id: number,
data: object
}
const updateConnectionResolver = async (params: Params, req: RequestWithCurrentUser) => {
@@ -27,7 +27,7 @@ const updateConnectionResolver = async (params: Params, req: RequestWithCurrentU
const updateConnection = {
type: connectionType,
args: {
id: { type: GraphQLNonNull(GraphQLString) },
id: { type: GraphQLNonNull(GraphQLInt) },
data: { type: GraphQLNonNull(GraphQLJSONObject) }
},
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => updateConnectionResolver(params, req)