Hello GraphQL

GraphQL vs GraphiQL

Notice the subtle difference in spelling there. One with the ‘i’ and one without the ‘i’.

  • GraphQL is the query language and the runtime for executing the queries.
  • GraphiQL is a tool / interface for testing queries and checking out the documentation. GraphiQL is an important tool to learn if you plan on learning and using GraphQL.

All of the examples on NPIQL, use GraphiQL. When you go to https://data.npiql.com using your web browser you will be using the GraphiQL interface to GraphQL.

Get started

  • Copy the following bit of code to your clipboard
  • Go to data.npiql.com
  • Paste the code in the left side window pane
  • Click the play button

Then come back and I’ll explain what just happened.

{
  npiSearch(number:1316276066){
    results{
      basic{
        first_name
        last_name
        last_updated
      }
    }
  }
}

Welcome Back

What you are doing with this query is searching for the NPI number 1316276066 and asking for the following data attributes.

  • first_name
  • last_name
  • last_updated

Assuming you did everything correctly, here are the results you should have seen.

Hello GraphiQL Example

Did you notice the the record was last updated in 2009? This is an example of why you need to think about how you use the NPI data. Keep in mind that some of the data is ok but some attributes are more likely to be outdated or incorrect. Attributes like the first name will not change very often. Last names are a little more likely to change. Addresses and phone number change more frequently and you may need to find another source for that information.

What’s Next?

You should go back to the data.npiql.com and try adding and removing different data attributes.

Pro Tip : Click the “Docs” link on the top right to see all of the different data attributes available.

Here’s another example query for you to get started.

{
  npiSearch(number:1316276066){
    results{
      basic{
        first_name
        last_name
        last_updated
      }
      addresses{
        address_1
        address_2
        address_purpose
        telephone_number
        fax_number
      }
    }
  }
}

GraphiQL Screen Shot

Made in California with Love