Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
( `\n)( query \{\n)( .*)(\{\n)( (.|\n|)[^;]*)( \}\n)( \}\n)( `)
/
gm
Input 1
import { gql } from '@apollo/client'; const getAccountingSubject = gql( ` query { accountingSubjects { id accountingSubjectNumber accountingSubjectTypeId accountingSubjectType { name code } accountingSubjectPrefixCodeId accountingSubjectCompanyType name note } } `, ); const getAccountingSubjectById = (id) => gql( ` query { accountingSubjects (where: {id: {eq: ${id}}}) { id accountingSubjectNumber accountingSubjectTypeId accountingSubjectType { name code } accountingSubjectPrefixCodeId accountingSubjectCompanyType name note } } `, ); export default { getAccountingSubject, getAccountingSubjectById, };
Extraction
import { gql } from '@apollo/client'; const getAccountingSubject = gql( ` query { accountingSubjects { id accountingSubjectNumber accountingSubjectTypeId accountingSubjectType { name code } accountingSubjectPrefixCodeId accountingSubjectCompanyType name note } } `, ); const getAccountingSubjectById = (id) => gql( ` query { accountingSubjects (where: {id: {eq: ${id}}}) { id accountingSubjectNumber accountingSubjectTypeId accountingSubjectType { name code } accountingSubjectPrefixCodeId accountingSubjectCompanyType name note } } `, ); export default { getAccountingSubject, getAccountingSubjectById, };