{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/278","repository_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet","labels_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/278/labels{/name}","comments_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/278/comments","events_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/278/events","html_url":"https://github.com/graphql-dotnet/graphql-dotnet/issues/278","id":206261833,"number":278,"title":"How to return a result dynamically?","user":{"login":"Kurren123","id":3525980,"avatar_url":"https://avatars2.githubusercontent.com/u/3525980?v=4","gravatar_id":"","url":"https://api.github.com/users/Kurren123","html_url":"https://github.com/Kurren123","followers_url":"https://api.github.com/users/Kurren123/followers","following_url":"https://api.github.com/users/Kurren123/following{/other_user}","gists_url":"https://api.github.com/users/Kurren123/gists{/gist_id}","starred_url":"https://api.github.com/users/Kurren123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kurren123/subscriptions","organizations_url":"https://api.github.com/users/Kurren123/orgs","repos_url":"https://api.github.com/users/Kurren123/repos","events_url":"https://api.github.com/users/Kurren123/events{/privacy}","received_events_url":"https://api.github.com/users/Kurren123/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2017-02-08T17:08:10Z","updated_at":"2018-05-14T19:18:39Z","closed_at":"2017-02-21T17:13:09Z","author_association":"NONE","body":"I don't know the fields I need at compile time. This example [here](https://github.com/graphql-dotnet/graphql-dotnet/blob/master/src/GraphQL.Tests/Execution/RegisteredInstanceTests.cs#L94-L118) builds a schema dynamically:\r\n\r\n```\r\nvar person = new ObjectGraphType();\r\nperson.Name = \"Person\";\r\nperson.Field(\"name\", new StringGraphType());\r\nperson.Field(\r\n    \"friends\",\r\n    new ListGraphType(new NonNullGraphType(person)),\r\n    resolve: ctx => new[] {new SomeObject {Name = \"Jaime\"}, new SomeObject {Name = \"Joe\"}});\r\n```\r\n\r\nHowever the field \"name\" is already compiled as a property in the `SomeObject` class. Is there a way I can return a value when I only know the fields at runtime? Maybe return a `Dictionary<String, Object>` or something?\r\n\r\nThanks for the help"},"comment":{"url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/comments/388931698","html_url":"https://github.com/graphql-dotnet/graphql-dotnet/issues/278#issuecomment-388931698","issue_url":"https://api.github.com/repos/graphql-dotnet/graphql-dotnet/issues/278","id":388931698,"user":{"login":"acronoah","id":30051812,"avatar_url":"https://avatars3.githubusercontent.com/u/30051812?v=4","gravatar_id":"","url":"https://api.github.com/users/acronoah","html_url":"https://github.com/acronoah","followers_url":"https://api.github.com/users/acronoah/followers","following_url":"https://api.github.com/users/acronoah/following{/other_user}","gists_url":"https://api.github.com/users/acronoah/gists{/gist_id}","starred_url":"https://api.github.com/users/acronoah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acronoah/subscriptions","organizations_url":"https://api.github.com/users/acronoah/orgs","repos_url":"https://api.github.com/users/acronoah/repos","events_url":"https://api.github.com/users/acronoah/events{/privacy}","received_events_url":"https://api.github.com/users/acronoah/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T19:18:39Z","updated_at":"2018-05-14T19:18:39Z","author_association":"NONE","body":"I am running into the same problem.  I pull data dynamically from an underlying database and have my schema defined externally in a .graphqls file.  I am able to successfully build the fields, but if I try to resolve with a List<dynamic> I get an error at runtime:  \r\n\r\n```\r\nGraphQL.ExecutionError: Error trying to resolve id. ---> System.InvalidOperationException: Expected to find property id on JObject but it does not exist.\\n   at GraphQL.Resolvers.NameFieldResolver.Resolve(Object source, String name)\\n   at GraphQL.Resolvers.NameFieldResolver.Resolve(ResolveFieldContext context)\\n   at GraphQL.Instrumentation.MiddlewareResolver.Resolve(ResolveFieldContext context)\\n\r\n```\r\n\r\nIs there any plan to natively support dynamics as @Kurren123 mentioned earlier?  I'm at the point where I am contemplating forking the repo to deal with the problem as he described.   Any other best places to start from or alternate solutions to returning a dynamic?"}}
{"actor":{"display_login":"acronoah"}}