cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between "Money" and "Money!" in graphql schema?

SOLVED

What is the difference between "Money" and "Money!" in graphql schema?

If we look at the vendor file in vendor/magento/module-catalog-graph-ql/etc/schema.graphqls which is defining the ProductInterface attributes.

 

Some objects had been defined as a "Money" and some are "Money!", so what is the difference?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: What is the difference between "Money" and "Money!" in graphql schema?

Have a look at the graphql documentation: https://graphql.org/learn/schema/#object-types-and-fields

It says for the type String:

  • String is one of the built-in scalar types - these are types that resolve to a single scalar object, and can't have sub-selections in the query. We'll go over scalar types more later.
  • String! means that the field is non-nullable, meaning that the GraphQL service promises to always give you a value when you query this field. In the type language, we'll represent those with an exclamation mark.

So "Money" means that the object is nullable and "Money!" means it's not, that's it.

View solution in original post

4 REPLIES 4

Re: What is the difference between "Money" and "Money!" in graphql schema?

Have a look at the graphql documentation: https://graphql.org/learn/schema/#object-types-and-fields

It says for the type String:

  • String is one of the built-in scalar types - these are types that resolve to a single scalar object, and can't have sub-selections in the query. We'll go over scalar types more later.
  • String! means that the field is non-nullable, meaning that the GraphQL service promises to always give you a value when you query this field. In the type language, we'll represent those with an exclamation mark.

So "Money" means that the object is nullable and "Money!" means it's not, that's it.

Re: What is the difference between "Money" and "Money!" in graphql schema?

I am glad I have found the solution. I also want to know this.

Re: What is the difference between "Money" and "Money!" in graphql schema?

I'm relieved to have discovered the answer. I'm also curious about this. This is one of my favorite web shows. If you want to get the most out of this hobby, pick the NZD online casino that requires the least amount of a deposit. Consequently, you won't have to spend a lot of money to enjoy this pastime. This article at LowDepositCasino NZ contains all the information you need to know about minimum deposit casinos in New Zealand. Along with the best minimum deposit amount accessible, the key benefits of each low deposit casino will be covered. Online video game playing is really enjoyable.

Re: What is the difference between "Money" and "Money!" in graphql schema?

No difference. With a two-dollar minimum deposit, you may do whatever you want and play as many games as you like at an online casino. These gaming environments are great for new players who want to learn as much as they can or for online gamblers who are always watching their wallets. With this risk-free gameplay, you may listen to as many songs as you like without worrying about accruing debt. Visit find out more about the $2 minimum deposit casino Canada, go to https://lowdepositcasino.org/2-dollar-deposit-casinos/ There aren't any casinos in Canada right now accepting deposits of less than $2. However, when new websites enter the market, these offers can become available.