firebase / firebase/firebase-tools

Firebase Dataconnect Compiler does not allow schema-defined types

Open
#9,167 5 comments 5 reactions 1 assignee Claimed by @mtr002 View on GitHub
api: dataconnect fr: dataconnect nested input reproducible type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Environment info

**firebase-tools:** 14.15.2

**Platform:** macOS, VSCode

### Test case

When implementing the "schema for a movie review app", exactly as per the documentation for data connect provided here:

https://firebase.google.com/docs/data-connect/schemas-guide#movie-schema-intro

And then following this documentation:

https://firebase.google.com/docs/data-connect/mutations-guide#generated-fields

To add the following mutation:

```
mutation CreateMovie($data: Movie_Data!) {
movie_insert(data: $data) { key }
}
```

the Firebase data connect compiler displays this error on the mutation:

"On $data: cannot use Movie_Data as a variable (please use one variable for each field instead, ex: `{foo: $foo}`)"

### Steps to reproduce

As per the above, simply follow the linked documentation to create the movie schema and add the mutation, also from the linked documentation.

### Expected behavior

There is no error OR the documentation clarifies that schema-defined types are not allowed as arguments, and does not use erroneous examples.

### Actual behavior

The Firebase data connect compiler displays this error on the mutation implemented exactly as per the documentation:

"On $data: cannot use Movie_Data as a variable (please use one variable for each field instead, ex: `{foo: $foo}`)"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.