Are `requests` counted individually or together fo...
# prisma-whats-new
m
Are
requests
counted individually or together for the pricing? For example, are these counted as three or as one request?
Copy code
graphql(createMessage, { name: 'createMessages' })(
	graphql(assignMessageToUser, { name: 'addToMessagesPerUser' })(
		graphql(updateMessage, { name: 'updateMessages' })(Support)
	)
)
s
@martin All queries and operations in a http request is counted. You should still batch requests when possible to reduce overall latency. If you are using Apollo this is also a great approach: https://www.graph.cool/blog/improving-performance-with-apollo-query-batching-ligh7fmn38
m
Thanks, @sorenbs. Didn’t you used to previously count queries and operations that were batched together as a single request? I vaguely remember reading this before you changed your pricing structure.
s
With the pricing change we wanted to streamline and make sure people aren't forced to write complex code purely to beat the pricing model. Charging per individual query/mutation is also better aligned with our cost structure, so more fair overall.
Do you think that’s a reasonable decision?
m
I think it depends: As beginning GraphQL developer, I’m concerned that I’m writing more queries & mutations than are necessary. That’s definitely a concern on my part.
s
The beauty of GraphQL is that you can often retrieve all the data you need for a screen with a single query where you would need to do 10+ requests with a traditional rest api.
Feel free to ask about concrete cases. Maybe we can help you model your data in a more optimal way
m
Thank you, @sorenbs! Maybe—if that’s ok—I’ll have you take a quick glance at my repo before I’m ready to launch it… to see if some of the queries could be made redundant.
And since I’m talking to the co-founder: for the record, I LOVE graph.cool and the plan is to build a ton of apps on your platform, one app cross-promoting the other. Hence my company’s brand… Conscious Apps.
❤️ 1
graphcool 2
n
@martin I can take a look once you're ready to publish 🙂
graphcool 1
🙌 1
s
Thanks Matrin - that is so nice to hear!
graphcool 1
m
No way! 😊 You have a graphcool emoji!
And thank you, @nilan!!
🙏 1
There’s a component that’s often being called, but requires graphql
requests
only a fraction of the time. Are requests automatically being generated if I load this component like this?
Copy code
export default
graphql(expireTrial, { name: 'expireTrial' })(
	graphql(createPurchase, { name: 'createPurchase' })(
		graphql(upgradeApp, { name: 'upgradeApp' })(Epub)
	)
)
n
Yes
If you only need the request being made for some cases, it's possible to introduce another parent component that manages that logic
m
Ok, thanks.