ConvertTo-BirdWeatherGraphQLQuery

SYNOPSIS

Builds a GraphQL document from a field path

SYNTAX

__AllParameterSets

ConvertTo-BirdWeatherGraphQLQuery [-Path] <string[]> [[-Variable] <Object[]>] [-Selection] <string>
 [[-OperationType] <string>] [[-OperationName] <string>] [-Connection]

ALIASES

This cmdlet has the following aliases,

  • ConvertTo-BWGQuery

DESCRIPTION

The ConvertTo-BirdWeatherGraphQLQuery cmdlet builds the GraphQL document that is sent to the BirdWeather GraphQL API

The path is the list of fields that are nested in each other, such as station & detections. The variables are placed on the field of their level & declared on the operation. The selection is used for the last field of the path

Connection fields return the nodes, the page information, & the total count This is an internal helper function that is used by the request function

EXAMPLES

EXAMPLE 1

ConvertTo-BirdWeatherGraphQLQuery -Path 'station' -Selection 'id name'

Returns ‘query Station { station { id name } }’

EXAMPLE 2

ConvertTo-BirdWeatherGraphQLQuery -Path 'stations' -Selection 'id' -Connection

Returns the query with the nodes, pageInfo, & totalCount of the stations connection

PARAMETERS

-Connection

The last field is a GraphQL connection, the selection is used for the nodes

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: ''

-OperationName

The name of the operation

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 4
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-OperationType

The type of the operation Allowed values: ‘Query’, ‘Mutation’

Type: System.String
DefaultValue: Query
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 3
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

The names of the nested fields, such as ‘station’, ‘detections’

Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Selection

The selection set of the last field, such as ‘id name’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 2
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Variable

The variables that were created by Get-BirdWeatherGraphQLVariable

Type: System.Object[]
DefaultValue: '@()'
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  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

OUTPUTS

System.String

NOTES

N/A