class

Detector::Specification::GraphqlOperation

Inherits Detector < Reference < Object

Instance methods

applicable?(filename : String) : Bool

Registers every operation document for the analyzer pass, so it must keep running after the first match.

.graphqls is SDL-only by convention and is deliberately absent: the extension list is the same one the file-analyzer hook this replaced tested for, so the set of files that can produce an endpoint is unchanged.

Source
detect(filename : String, file_contents : String) : Bool

The claim test is the analyzer's parse, stopped at the first operation. A cheaper keyword sniff would have to be either looser than the parser (claiming SDL schemas, which belong to graphql_sdl) or tighter (dropping documents the analyzer can read), and either way the detector and the analyzer would disagree about the same file.

Source
idempotent?

Registers every operation document for the analyzer pass, so it must keep running after the first match.

.graphqls is SDL-only by convention and is deliberately absent: the extension list is the same one the file-analyzer hook this replaced tested for, so the set of files that can produce an endpoint is unchanged.

Source
name

Registers every operation document for the analyzer pass, so it must keep running after the first match.

.graphqls is SDL-only by convention and is deliberately absent: the extension list is the same one the file-analyzer hook this replaced tested for, so the set of files that can produce an endpoint is unchanged.

Source