这是indexloc提供的服务,不要输入任何密码
Skip to content

Actions do not support returning scalar types #7805

@samuela

Description

@samuela

Version Information

Server Version: v2.0.10
CLI Version (for CLI related issue): n/a

Environment

macOS 11.6

What is the expected behaviour?

Creating an Action like

type Mutation {
  StartCuddlefishSession2(github_access_token: String!): String!
}

to work.

Keywords

Actions, graphql, scalar types, custom types

What is the current behaviour?

I'm getting an error:

{
    "internal": [
        {
            "definition": {
                "definition": {
                    "kind": "synchronous",
                    "output_type": "String!",
                    "arguments": [
                        {
                            "name": "github_access_token",
                            "type": "String!",
                            "description": null
                        }
                    ],
                    "headers": [
                        {
                            "name": "x-api-secret",
                            "value_from_env": "API_SECRET"
                        }
                    ],
                    "handler": "http://{{NEXT_HOST}}:{{NEXT_PORT}}/api/start_cuddlefish_session",
                    "type": "mutation",
                    "timeout": 30,
                    "forward_client_headers": false
                },
                "name": "StartCuddlefishSession2",
                "comment": "Start a new Cuddlefish session provided a GitHub auth token"
            },
            "reason": "Inconsistent object: in action \"StartCuddlefishSession2\"; the type: \"String\" is not an object type defined in custom types",
            "name": "action StartCuddlefishSession2",
            "type": "action"
        }
    ],
    "path": "$.args[1].args",
    "error": "Inconsistent object: in action \"StartCuddlefishSession2\"; the type: \"String\" is not an object type defined in custom types",
    "code": "invalid-configuration"
}

How to reproduce the issue?

  1. Try to create an action with a mutation type, returning a base scalar type like String
  2. Empty out the "New types definition" text box.
  3. Click "Create"

Screenshots or Screencast

Screen Shot 2021-11-11 at 7 34 00 PM

Please provide any traces or logs that could help here.

n/a

Any possible solutions?

Having to create custom types for every action

Can you identify the location in the source code where the problem exists?

n/a

If the bug is confirmed, would you be willing to submit a PR?

yes

Metadata

Metadata

Assignees

Labels

c/actionsRelated to actionsc/serverRelated to serverk/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions