function getValidRelayQLTag(path: any): [any, ?string, ?string] {
  const {node} = path;

  const tag = path.get('tag');
  const tagName = tag.matchesPattern('Relay.QL')
    ? 'Relay.QL'
    : tag.matchesPattern('RelayClassic_DEPRECATED.QL')
    ? 'RelayClassic_DEPRECATED.QL'
    : tag.matchesPattern('RelayClassic.QL')
    ? 'RelayClassic.QL'
    : tag.isIdentifier({name: 'RelayQL'})
    ? 'RelayQL'
    : null;
  if (!tagName) {
    return [null, null, null];
  }

  let p = path;
  let propName = null;
  while (!propName && (p = p.parentPath)) {
    if (p.isProperty()) {
      propName = p.node.key.name;
    }
  }

  return [node.quasi, tagName, propName];
}
function getValidRelayQLTag(path: any): [any, ?string, ?string] {
  const {node} = path;

  const tag = path.get('tag');
  const tagName = tag.matchesPattern('Relay.QL')
    ? 'Relay.QL'
    : tag.matchesPattern('RelayClassic_DEPRECATED.QL')
    ? 'RelayClassic_DEPRECATED.QL'
    : tag.matchesPattern('RelayClassic.QL')
    ? 'RelayClassic.QL'
    : tag.isIdentifier({name: 'RelayQL'})
    ? 'RelayQL'
    : null;
  if (!tagName) {
    return [null, null, null];
  }

  let p = path;
  let propName = null;
  while (!propName && (p = p.parentPath)) {
    if (p.isProperty()) {
      propName = p.node.key.name;
    }
  }

  return [node.quasi, tagName, propName];
}
function getValidRelayQLTag ( path : any ) : [ any , ? string , ? string ] { const { node } = path ; const tag = path . get ( 'tag' ) ; const tagName = tag . matchesPattern ( 'Relay.QL' ) ? 'Relay.QL' : tag . matchesPattern ( 'RelayClassic_DEPRECATED.QL' ) ? 'RelayClassic_DEPRECATED.QL' : tag . matchesPattern ( 'RelayClassic.QL' ) ? 'RelayClassic.QL' : tag . isIdentifier ( { name : 'RelayQL' } ) ? 'RelayQL' : null ; if ( ! tagName ) { return [ null , null , null ] ; } let p = path ; let propName = null ; while ( ! propName && ( p = p . parentPath ) ) { if ( p . isProperty ( ) ) { propName = p . node . key . name ; } } return [ node . quasi , tagName , propName ] ; }
Given a TemplateLiteral path, return the metadata about a RelayQL tag
if one exists.
Given a TemplateLiteral path return the metadata about a RelayQL tag if one exists .
Returns the valid tag name and property name of the node