Skip to content
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

Introspection returns OrderArg with null inputFields #1632

Closed
nasdf opened this issue Jul 12, 2023 · 1 comment · Fixed by #1633
Closed

Introspection returns OrderArg with null inputFields #1632

nasdf opened this issue Jul 12, 2023 · 1 comment · Fixed by #1633
Assignees
Labels
area/query Related to the query component bug Something isn't working

Comments

@nasdf
Copy link
Member

nasdf commented Jul 12, 2023

Describe the problem
When introspecting a schema with a many-to-one relationship it returns an OrderArg with null inputFields. This causes an error in the latest GraphiQL.

To Reproduce
Create a schema with a many-to-one relationship and run introspection.

type user {
    age: Int
    name: String
    points: Float
    verified: Boolean
}

type group {
    members: [user]
}

Expected behavior
I believe the expected behavior is to return the OrderArg object with at least 1 inputField.

Platform
MacOS develop branch

Additional context

Introspection result excerpt:

...
{
    "description": "",
    "enumValues": null,
    "fields": null,
    "inputFields": null,
    "interfaces": null,
    "kind": "INPUT_OBJECT",
    "name": "groupOrderArg",
    "possibleTypes": null
}
...

Error from GraphiQL:

{
  "errors": [
    {
      "message": "Introspection result missing inputFields: { description: \"\", enumValues: null, fields: null, inputFields: null, interfaces: null, kind: \"INPUT_OBJECT\", name: \"groupOrderArg\", possibleTypes: null }.",
      "stack": "Error: Introspection result missing inputFields: { description: \"\", enumValues: null, fields: null, inputFields: null, interfaces: null, kind: \"INPUT_OBJECT\", name: \"groupOrderArg\", possibleTypes: null }.\n    at buildInputObjectDef (http://localhost:5173/node_modules/.vite/deps/chunk-JJM3ZUCC.js?v=1e9f098c:8874:13)\n    at buildType (http://localhost:5173/node_modules/.vite/deps/chunk-JJM3ZUCC.js?v=1e9f098c:8795:18)\n    at http://localhost:5173/node_modules/.vite/deps/chunk-JJM3ZUCC.js?v=1e9f098c:8724:28\n    at keyValMap (http://localhost:5173/node_modules/.vite/deps/chunk-JJM3ZUCC.js?v=1e9f098c:3137:27)\n    at buildClientSchema (http://localhost:5173/node_modules/.vite/deps/chunk-JJM3ZUCC.js?v=1e9f098c:8721:19)\n    at http://localhost:5173/node_modules/.vite/deps/chunk-5EYXVEAX.js?v=1e9f098c:23864:27"
    }
  ]
}
@nasdf nasdf added bug Something isn't working area/query Related to the query component labels Jul 12, 2023
@nasdf nasdf self-assigned this Jul 12, 2023
@fredcarle
Copy link
Collaborator

Related issues: #1502 and #1463

nasdf added a commit that referenced this issue Jul 13, 2023
## Relevant issue(s)

Resolves #1632 
Resolves #1502 
Resolves #1463

## Description

This PR adds an introspection test that identifies an issue with
`orderArg`.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`make test`

Specify the platform(s) on which this was tested:
- MacOS
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
)

## Relevant issue(s)

Resolves sourcenetwork#1632 
Resolves sourcenetwork#1502 
Resolves sourcenetwork#1463

## Description

This PR adds an introspection test that identifies an issue with
`orderArg`.

## Tasks

- [x] I made sure the code is well commented, particularly
hard-to-understand areas.
- [x] I made sure the repository-held documentation is changed
accordingly.
- [x] I made sure the pull request title adheres to the conventional
commit style (the subset used in the project can be found in
[tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)).
- [x] I made sure to discuss its limitations such as threats to
validity, vulnerability to mistake and misuse, robustness to
invalidation of assumptions, resource requirements, ...

## How has this been tested?

`make test`

Specify the platform(s) on which this was tested:
- MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants