-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EF issue - user is a value type and cannot be selected from #92
Comments
What's the query you're running? Is |
Thanks for Replying!
The main query im trying to run is to find any NTC_TC_MAIN with the name "Hudson".
I was running into a similar issue as #49, where I inherited a database with names that are all uppercased. I don't know if it helps but everything works fine the moment I I grab a list and instantiate a new context like so, it works:
But I don't want to call and grab the entire list all the time. Would rather be able to run the graphQL query and filter based on that. |
Can you try using FirstOrDefault? |
changed to: |
`AddField` should return a `GraphQLFieldBuilder`. Can you assign that to a
variable and inspect the private fields in the debugger (expand the _field
field and its Type property), then paste the results here?
…On Tue, Mar 27, 2018 at 10:49 AM ronnpang1 ***@***.***> wrote:
changed to:
schema.AddField("user", new { id = "-1" }, (db, args) =>
db.NTC_TC_MAINS.Where(u => u.TC_NAME == args.id).FirstOrDefault());
Still gives me the same exception though
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2KwpwteFSqOemtGFM85f2IlnHVmBJHks5tilGOgaJpZM4S70q9>
.
|
So the immediate issue is that type.IsScalar is true, which is definitely
not correct. I'll have to think some on why that could be.
Is it possible that `NTC_TC_MAINS` is defined twice in your project, and
that the one used in `schema.AddType<NTC_TC_MAINS>().AddAllFields();` is
not the same as the one used in `db.NTC_TC_MAINS`?
…On Tue, Mar 27, 2018 at 11:25 AM ronnpang1 ***@***.***> wrote:
Expanding the _fields gives:
[image: prnt1]
<https://user-images.githubusercontent.com/4573812/37977293-717b3b4c-31b1-11e8-88c6-8a76a44e7826.png>
Expanding the type yields:
[image: prnt2]
<https://user-images.githubusercontent.com/4573812/37977325-7c7c1b74-31b1-11e8-97ae-78f69125e348.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2KwqKocyxU9qoU1m_gVLhPb8pO8ut_ks5tilnZgaJpZM4S70q9>
.
|
Oh man, you were absolutely right, NTC_MAIN was defined twice accidentally. |
Hi, all
I'm having a bit of an issue with graphql. I'm trying to query my dataset but im running into problems the moment I try execute a query. I get the exeception:
GraphQL.Parser.SourceException: 'field ``user'' is a value type and cannot be selected from'
My code is as follows:
With the following DBset:
public DbSet<NTC_TC_MAINS> NTC_TC_MAINS { get; set; }
The exception is as follows is as follows:
GraphQL.Parser.SourceException occurred
HResult=0x80131500
Message=field ``user'' is a value type and cannot be selected from
Source=GraphQL.Parser
StackTrace:
Any advice into solving this would be greatly helpful!
The text was updated successfully, but these errors were encountered: