Title: apollo-link-state: How to specify object type parameter on typeDefs less state link?
Tags: javascript;graphql;apollo-client
Question: I am creating my ```stateLink``` without providing a schema like this:

```const stateLink = withClientState({
  cache,
  resolvers,
  defaults
})
```

I have a mutation that take an Object as parameter:

```MY_MUTATION = gql`mutation myMutation($product: Product) {...}`
```

Since there is no ```typeDefs``` (no ```Product``` object type), and there is no type checking anyway, how can I specify that the ```$product``` argument is an object and not a scalar type ?

Comment: No you don't get the point. What is here `gql(...)` is not JS, but GraphQL Query Language. I got my answer. With apollo-link-state there is no type checking. So you can put whatever you want there , `Product`, `Int` or whatever, as long as the argument works well with your resolver's code.

Comment: OK, good to know.

Comment: I am not sure to unserstand what exactly you are trying to achieve. To who/what do you want to specify the type to? If you are expecting type-checking, you should be using a type-checking tool like flow, typescript or even another language than JS because JS is not typed.

Comment: I do get the point :) I use apollo client and server with typescript and use graphql code generator to generate typescript types from my schema and queries. This way I get type checking at compile time



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:09/12/18', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<javascript><graphql><apollo-client>', 'Title': 'apollo-link-state: How to specify object type parameter on typeDefs less state link?', 'ViewCount': 104, 'id': 52303602, 'user_AboutMe': '', 'user_AccountId': 3350414.0, 'user_DisplayName': 'acmoune', 'user_Reputation': 2463.0, 'user_Views': 284.0, 'user_id': 2814580.0}}