Best practices

GraphQL is a powerful and efficient API language. Here are a few ways you can structure and craft your code to build world-class apps.

Only query for the data your app needs

In GraphQL, less is more. Create queries that only request the specific fields and data required for your QuickBooks integration to be fully functional. You can change queries later and add more fields as needed.

Log frequently during development

Take the time to properly log your app development process. It saves time in the long run. Logging every execution may impact app performance, so prioritize what matters most.

Tip: Always log the value of the intuit_tid field in the server response. It will help our support team quickly find and address any reported issues.

Use aliases to query the same field with different arguments

Aliases let you rename the results of identical object fields so you can query the same field for different arguments. You can pass multiple queries at once and get responses for both fields without conflict.

Always include operation names to avoid confusion

Use operation names that make your code clear, concrete, and unambiguous.

Create fragments to speed up code writing

Instead of querying frequently used fields individually, create and reuse fragments whenever possible. This makes code modular and easier to scale.

Use pagination to quickly navigate large datasets

If you expect a query to return lots of data, use pagination to fetch specific subsets.

Learn about API call limits and throttling

Our servers will throttle requests after an app sends a specific number of requests. For specific information about call limits and throttling, see API call limits and throttles.