Vincit / objection-graphql

GraphQL schema generator for objection.js
MIT License
307 stars 35 forks source link

Inconsistent behavior for a complex query #18

Closed nasushkov closed 6 years ago

nasushkov commented 7 years ago

I have a hierarchical query which looks like this:

roomJobSettings (style: "${style}"){       
            roomType,
            jobGroup {
              id,        
             //...      
              jobCategory {
                id,
                //...
              },    
              materialType {
                id,
               //...
                materials {
                  id,
                  //...
                  jobGroupMaterials {            
                    //..
                  },
                  materialStyles (style: "${style}") {
                    id, 
                   //...
                  }
                }
              }
            }
          }

For some reason this query result for materialStyles is inconsistent: sometiimes it retrieves something and sometimes it's empty. What can be the reason for this?

koskimas commented 7 years ago

I'm pretty sure this is a user error. There is nothing random about this library. The results should be deterministic. I'll investigate if you can provide a standalone reproduction that I can debug.

koskimas commented 7 years ago

Is style marked as an enum in jsonSchema?

nasushkov commented 7 years ago

@koskimas no style is just a string. Actually it deesn't affect anything: I see the same behavior, when style is omitted. Ok, I'll try to provide a sandox for this case.