UNPKG

@dillonkearns/elm-graphql

Version:

<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">

18 lines (14 loc) 383 B
"use strict"; const parseQuery = require("./parseQuery"); function getOptions(loaderContext) { const query = loaderContext.query; if(typeof query === "string" && query !== "") { return parseQuery(loaderContext.query); } if(!query || typeof query !== "object") { // Not object-like queries are not supported. return null; } return query; } module.exports = getOptions;