Get-BirdWeatherGraphQLQuery
SYNOPSIS
Sends a custom GraphQL query to the BirdWeather GraphQL API
SYNTAX
__AllParameterSets
Get-BirdWeatherGraphQLQuery [-Query] <string> [-Variable <hashtable>] [-Raw]
ALIASES
This cmdlet has the following aliases,
- Get-BWGQuery
DESCRIPTION
The Get-BirdWeatherGraphQLQuery cmdlet sends a GraphQL document to the BirdWeather GraphQL API as is. Use this cmdlet when none of the other functions return the data that you need, such as combining a station & the species of the station in one request
The BirdWeather GraphQL schema is stored in the docs\BirdWeatherGraphQL.json file of the project and the online documentation is hosted at https://app.birdweather.com/api/index.html
Only the data of the response is returned by default, GraphQL errors are reported as errors
EXAMPLES
EXAMPLE 1
Get-BirdWeatherGraphQLQuery -Query 'query { counts { stations species detections } }'
Returns the counts of the stations, species, & detections
EXAMPLE 2
Get-BirdWeatherGraphQLQuery -Query 'query($id: ID!) { station(id: $id) { name coords { lat lon } } }' -Variable @{ id = '21934' }
Returns the name & the coordinates of a station using a GraphQL variable
PARAMETERS
-Query
The GraphQL document to send
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Raw
Returns the full API response (data & errors) instead of only the data
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Variable
Hashtable of the variables that are used by the GraphQL document
Type: System.Collections.Hashtable
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.String
OUTPUTS
NOTES
GraphQL : Query (any)