{"action":"closed","issue":{"url":"https://api.github.com/repos/dotansimha/graphql-code-generator/issues/410","repository_url":"https://api.github.com/repos/dotansimha/graphql-code-generator","labels_url":"https://api.github.com/repos/dotansimha/graphql-code-generator/issues/410/labels{/name}","comments_url":"https://api.github.com/repos/dotansimha/graphql-code-generator/issues/410/comments","events_url":"https://api.github.com/repos/dotansimha/graphql-code-generator/issues/410/events","html_url":"https://github.com/dotansimha/graphql-code-generator/issues/410","id":338253363,"node_id":"MDU6SXNzdWUzMzgyNTMzNjM=","number":410,"title":"generate type for the root object resolver","user":{"login":"jaimesangcap","id":1907740,"node_id":"MDQ6VXNlcjE5MDc3NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/1907740?v=4","gravatar_id":"","url":"https://api.github.com/users/jaimesangcap","html_url":"https://github.com/jaimesangcap","followers_url":"https://api.github.com/users/jaimesangcap/followers","following_url":"https://api.github.com/users/jaimesangcap/following{/other_user}","gists_url":"https://api.github.com/users/jaimesangcap/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimesangcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimesangcap/subscriptions","organizations_url":"https://api.github.com/users/jaimesangcap/orgs","repos_url":"https://api.github.com/users/jaimesangcap/repos","events_url":"https://api.github.com/users/jaimesangcap/events{/privacy}","received_events_url":"https://api.github.com/users/jaimesangcap/received_events","type":"User","site_admin":false},"labels":[{"id":495014432,"node_id":"MDU6TGFiZWw0OTUwMTQ0MzI=","url":"https://api.github.com/repos/dotansimha/graphql-code-generator/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":748046606,"node_id":"MDU6TGFiZWw3NDgwNDY2MDY=","url":"https://api.github.com/repos/dotansimha/graphql-code-generator/labels/waiting-for-release","name":"waiting-for-release","color":"dfff8e","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-04T12:18:24Z","updated_at":"2018-08-06T05:16:48Z","closed_at":"2018-08-06T05:16:48Z","author_association":"NONE","body":"The `graphql-codegen-typescript-template` generates types as follows:\r\n\r\n```\r\n// schema.gql\r\n#import \"./types.gql\"\r\ntype Query {\r\n  me: User!\r\n}\r\n\r\ntype schema {\r\n  query: Query\r\n}\r\n\r\ntype User {\r\n  Id: String!\r\n  UserName: String!\r\n}\r\n\r\n// generated types\r\n/* tslint:disable */\r\nimport { GraphQLResolveInfo } from 'graphql'\r\n\r\ntype Resolver<Result, Args = any> = (\r\n  parent: any,\r\n  args: Args,\r\n  context: any,\r\n  info: GraphQLResolveInfo\r\n) => Promise<Result> | Result\r\n\r\nexport interface Query {\r\n  me: User\r\n}\r\n\r\nexport interface User {\r\n  Id: string\r\n  UserName: string\r\n}\r\n\r\nexport interface schema {\r\n  query?: Query | null\r\n}\r\n\r\nexport namespace QueryResolvers {\r\n  export interface Resolvers {\r\n    me?: MeResolver\r\n  }\r\n\r\n  export type MeResolver = Resolver<User>\r\n}\r\n\r\nexport namespace UserResolvers {\r\n  export interface Resolvers {\r\n    Id?: IdResolver\r\n    UserName?: UserNameResolver\r\n  }\r\n\r\n  export type IdResolver = Resolver<string>\r\n  export type UserNameResolver = Resolver<string>\r\n}\r\n\r\nexport namespace schemaResolvers {\r\n  export interface Resolvers {\r\n    query?: QueryResolver\r\n  }\r\n\r\n  export type QueryResolver = Resolver<Query | null>\r\n}\r\n\r\n```\r\n\r\nIs it possible to generate single type that contains all the resolvers nestedly, instead of spreading them into namespaces? Just an example of what I'm thinking...\r\n\r\nThis somehow follow the shape of the `graphql-tools` for the resolvers.\r\n\r\n```\r\ninterface IResolvers<TContext> {\r\n  Query: {\r\n    me: MeResolver<TContext>,\r\n    you: YouResolver<TContext>\r\n  },\r\n  Mutation: {\r\n    add: AddResolver<TContext>\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"dotansimha"}}