Best JavaScript code snippet using storybook-root
helpers.ts
Source:helpers.ts
1import {2 FieldPolicy,3 FieldReadFunction,4 TypePolicies,5 TypePolicy6} from "@apollo/client/cache";7export type AccountKeySpecifier = (8 | "access_token"9 | "expires_at"10 | "id"11 | "id_token"12 | "oauth_token"13 | "oauth_token_secret"14 | "provider"15 | "providerAccountId"16 | "refresh_secret"17 | "refresh_token"18 | "scope"19 | "session_state"20 | "token_type"21 | "type"22 | "user"23 | "userId"24 | AccountKeySpecifier25)[];26export type AccountFieldPolicy = {27 access_token?: FieldPolicy<any> | FieldReadFunction<any>;28 expires_at?: FieldPolicy<any> | FieldReadFunction<any>;29 id?: FieldPolicy<any> | FieldReadFunction<any>;30 id_token?: FieldPolicy<any> | FieldReadFunction<any>;31 oauth_token?: FieldPolicy<any> | FieldReadFunction<any>;32 oauth_token_secret?: FieldPolicy<any> | FieldReadFunction<any>;33 provider?: FieldPolicy<any> | FieldReadFunction<any>;34 providerAccountId?: FieldPolicy<any> | FieldReadFunction<any>;35 refresh_secret?: FieldPolicy<any> | FieldReadFunction<any>;36 refresh_token?: FieldPolicy<any> | FieldReadFunction<any>;37 scope?: FieldPolicy<any> | FieldReadFunction<any>;38 session_state?: FieldPolicy<any> | FieldReadFunction<any>;39 token_type?: FieldPolicy<any> | FieldReadFunction<any>;40 type?: FieldPolicy<any> | FieldReadFunction<any>;41 user?: FieldPolicy<any> | FieldReadFunction<any>;42 userId?: FieldPolicy<any> | FieldReadFunction<any>;43};44export type AuthKeySpecifier = (45 | "accessToken"46 | "refreshToken"47 | "session"48 | "user"49 | AuthKeySpecifier50)[];51export type AuthFieldPolicy = {52 accessToken?: FieldPolicy<any> | FieldReadFunction<any>;53 refreshToken?: FieldPolicy<any> | FieldReadFunction<any>;54 session?: FieldPolicy<any> | FieldReadFunction<any>;55 user?: FieldPolicy<any> | FieldReadFunction<any>;56};57export type AuthDetailedKeySpecifier = (58 | "auth"59 | "jwt"60 | AuthDetailedKeySpecifier61)[];62export type AuthDetailedFieldPolicy = {63 auth?: FieldPolicy<any> | FieldReadFunction<any>;64 jwt?: FieldPolicy<any> | FieldReadFunction<any>;65};66export type BaseTypeNodesKeySpecifier = (67 | "nodes"68 | "pageInfo"69 | "totalCount"70 | BaseTypeNodesKeySpecifier71)[];72export type BaseTypeNodesFieldPolicy = {73 nodes?: FieldPolicy<any> | FieldReadFunction<any>;74 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;75 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;76};77export type BaseTypesEdgeKeySpecifier = (78 | "cursor"79 | "node"80 | BaseTypesEdgeKeySpecifier81)[];82export type BaseTypesEdgeFieldPolicy = {83 cursor?: FieldPolicy<any> | FieldReadFunction<any>;84 node?: FieldPolicy<any> | FieldReadFunction<any>;85};86export type CategoryKeySpecifier = (87 | "_count"88 | "createdAt"89 | "creator"90 | "creatorId"91 | "entries"92 | "entryId"93 | "id"94 | "name"95 | "updatedAt"96 | CategoryKeySpecifier97)[];98export type CategoryFieldPolicy = {99 _count?: FieldPolicy<any> | FieldReadFunction<any>;100 createdAt?: FieldPolicy<any> | FieldReadFunction<any>;101 creator?: FieldPolicy<any> | FieldReadFunction<any>;102 creatorId?: FieldPolicy<any> | FieldReadFunction<any>;103 entries?: FieldPolicy<any> | FieldReadFunction<any>;104 entryId?: FieldPolicy<any> | FieldReadFunction<any>;105 id?: FieldPolicy<any> | FieldReadFunction<any>;106 name?: FieldPolicy<any> | FieldReadFunction<any>;107 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;108};109export type CategoryConnectionKeySpecifier = (110 | "edges"111 | "pageInfo"112 | "totalCount"113 | CategoryConnectionKeySpecifier114)[];115export type CategoryConnectionFieldPolicy = {116 edges?: FieldPolicy<any> | FieldReadFunction<any>;117 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;118 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;119};120export type CategoryCountKeySpecifier = (121 | "entries"122 | CategoryCountKeySpecifier123)[];124export type CategoryCountFieldPolicy = {125 entries?: FieldPolicy<any> | FieldReadFunction<any>;126};127export type CategoryEdgeKeySpecifier = (128 | "cursor"129 | "node"130 | CategoryEdgeKeySpecifier131)[];132export type CategoryEdgeFieldPolicy = {133 cursor?: FieldPolicy<any> | FieldReadFunction<any>;134 node?: FieldPolicy<any> | FieldReadFunction<any>;135};136export type CommentKeySpecifier = (137 | "author"138 | "authorId"139 | "body"140 | "createdAt"141 | "entry"142 | "entryId"143 | "id"144 | "position"145 | "reactions"146 | "updatedAt"147 | CommentKeySpecifier148)[];149export type CommentFieldPolicy = {150 author?: FieldPolicy<any> | FieldReadFunction<any>;151 authorId?: FieldPolicy<any> | FieldReadFunction<any>;152 body?: FieldPolicy<any> | FieldReadFunction<any>;153 createdAt?: FieldPolicy<any> | FieldReadFunction<any>;154 entry?: FieldPolicy<any> | FieldReadFunction<any>;155 entryId?: FieldPolicy<any> | FieldReadFunction<any>;156 id?: FieldPolicy<any> | FieldReadFunction<any>;157 position?: FieldPolicy<any> | FieldReadFunction<any>;158 reactions?: FieldPolicy<any> | FieldReadFunction<any>;159 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;160};161export type CommentConnectionKeySpecifier = (162 | "edges"163 | "pageInfo"164 | "totalCount"165 | CommentConnectionKeySpecifier166)[];167export type CommentConnectionFieldPolicy = {168 edges?: FieldPolicy<any> | FieldReadFunction<any>;169 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;170 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;171};172export type CommentEdgeKeySpecifier = (173 | "cursor"174 | "node"175 | CommentEdgeKeySpecifier176)[];177export type CommentEdgeFieldPolicy = {178 cursor?: FieldPolicy<any> | FieldReadFunction<any>;179 node?: FieldPolicy<any> | FieldReadFunction<any>;180};181export type ConnectionKeySpecifier = (182 | "email"183 | "firstName"184 | "id"185 | "ip"186 | "lastModified"187 | "lastName"188 | "owner"189 | "ownerId"190 | "phoneNumber"191 | ConnectionKeySpecifier192)[];193export type ConnectionFieldPolicy = {194 email?: FieldPolicy<any> | FieldReadFunction<any>;195 firstName?: FieldPolicy<any> | FieldReadFunction<any>;196 id?: FieldPolicy<any> | FieldReadFunction<any>;197 ip?: FieldPolicy<any> | FieldReadFunction<any>;198 lastModified?: FieldPolicy<any> | FieldReadFunction<any>;199 lastName?: FieldPolicy<any> | FieldReadFunction<any>;200 owner?: FieldPolicy<any> | FieldReadFunction<any>;201 ownerId?: FieldPolicy<any> | FieldReadFunction<any>;202 phoneNumber?: FieldPolicy<any> | FieldReadFunction<any>;203};204export type ConnectionConnectionKeySpecifier = (205 | "edges"206 | "pageInfo"207 | "totalCount"208 | ConnectionConnectionKeySpecifier209)[];210export type ConnectionConnectionFieldPolicy = {211 edges?: FieldPolicy<any> | FieldReadFunction<any>;212 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;213 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;214};215export type ConnectionEdgeKeySpecifier = (216 | "cursor"217 | "node"218 | ConnectionEdgeKeySpecifier219)[];220export type ConnectionEdgeFieldPolicy = {221 cursor?: FieldPolicy<any> | FieldReadFunction<any>;222 node?: FieldPolicy<any> | FieldReadFunction<any>;223};224export type ContentNodesKeySpecifier = (225 | "contentNodes"226 | ContentNodesKeySpecifier227)[];228export type ContentNodesFieldPolicy = {229 contentNodes?: FieldPolicy<any> | FieldReadFunction<any>;230};231export type EntryKeySpecifier = (232 | "_count"233 | "author"234 | "authorId"235 | "categories"236 | "categoryId"237 | "comments"238 | "content"239 | "createdAt"240 | "featuredImage"241 | "id"242 | "published"243 | "title"244 | "updatedAt"245 | EntryKeySpecifier246)[];247export type EntryFieldPolicy = {248 _count?: FieldPolicy<any> | FieldReadFunction<any>;249 author?: FieldPolicy<any> | FieldReadFunction<any>;250 authorId?: FieldPolicy<any> | FieldReadFunction<any>;251 categories?: FieldPolicy<any> | FieldReadFunction<any>;252 categoryId?: FieldPolicy<any> | FieldReadFunction<any>;253 comments?: FieldPolicy<any> | FieldReadFunction<any>;254 content?: FieldPolicy<any> | FieldReadFunction<any>;255 createdAt?: FieldPolicy<any> | FieldReadFunction<any>;256 featuredImage?: FieldPolicy<any> | FieldReadFunction<any>;257 id?: FieldPolicy<any> | FieldReadFunction<any>;258 published?: FieldPolicy<any> | FieldReadFunction<any>;259 title?: FieldPolicy<any> | FieldReadFunction<any>;260 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;261};262export type EntryConnectionKeySpecifier = (263 | "edges"264 | "pageInfo"265 | "totalCount"266 | EntryConnectionKeySpecifier267)[];268export type EntryConnectionFieldPolicy = {269 edges?: FieldPolicy<any> | FieldReadFunction<any>;270 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;271 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;272};273export type EntryCountKeySpecifier = (274 | "categories"275 | "comments"276 | EntryCountKeySpecifier277)[];278export type EntryCountFieldPolicy = {279 categories?: FieldPolicy<any> | FieldReadFunction<any>;280 comments?: FieldPolicy<any> | FieldReadFunction<any>;281};282export type EntryEdgeKeySpecifier = (283 | "cursor"284 | "node"285 | EntryEdgeKeySpecifier286)[];287export type EntryEdgeFieldPolicy = {288 cursor?: FieldPolicy<any> | FieldReadFunction<any>;289 node?: FieldPolicy<any> | FieldReadFunction<any>;290};291export type JwtDecodedKeySpecifier = (292 | "header"293 | "payload"294 | "signature"295 | JwtDecodedKeySpecifier296)[];297export type JwtDecodedFieldPolicy = {298 header?: FieldPolicy<any> | FieldReadFunction<any>;299 payload?: FieldPolicy<any> | FieldReadFunction<any>;300 signature?: FieldPolicy<any> | FieldReadFunction<any>;301};302export type JwtHeadersKeySpecifier = (303 | "alg"304 | "typ"305 | JwtHeadersKeySpecifier306)[];307export type JwtHeadersFieldPolicy = {308 alg?: FieldPolicy<any> | FieldReadFunction<any>;309 typ?: FieldPolicy<any> | FieldReadFunction<any>;310};311export type JwtPayloadKeySpecifier = (312 | "exp"313 | "iat"314 | "userId"315 | JwtPayloadKeySpecifier316)[];317export type JwtPayloadFieldPolicy = {318 exp?: FieldPolicy<any> | FieldReadFunction<any>;319 iat?: FieldPolicy<any> | FieldReadFunction<any>;320 userId?: FieldPolicy<any> | FieldReadFunction<any>;321};322export type MediaItemKeySpecifier = (323 | "fileLastModified"324 | "height"325 | "id"326 | "name"327 | "quality"328 | "size"329 | "src"330 | "srcSet"331 | "type"332 | "updatedAt"333 | "uploadedAt"334 | "user"335 | "userId"336 | "width"337 | MediaItemKeySpecifier338)[];339export type MediaItemFieldPolicy = {340 fileLastModified?: FieldPolicy<any> | FieldReadFunction<any>;341 height?: FieldPolicy<any> | FieldReadFunction<any>;342 id?: FieldPolicy<any> | FieldReadFunction<any>;343 name?: FieldPolicy<any> | FieldReadFunction<any>;344 quality?: FieldPolicy<any> | FieldReadFunction<any>;345 size?: FieldPolicy<any> | FieldReadFunction<any>;346 src?: FieldPolicy<any> | FieldReadFunction<any>;347 srcSet?: FieldPolicy<any> | FieldReadFunction<any>;348 type?: FieldPolicy<any> | FieldReadFunction<any>;349 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;350 uploadedAt?: FieldPolicy<any> | FieldReadFunction<any>;351 user?: FieldPolicy<any> | FieldReadFunction<any>;352 userId?: FieldPolicy<any> | FieldReadFunction<any>;353 width?: FieldPolicy<any> | FieldReadFunction<any>;354};355export type MediaItemConnectionKeySpecifier = (356 | "edges"357 | "pageInfo"358 | "totalCount"359 | MediaItemConnectionKeySpecifier360)[];361export type MediaItemConnectionFieldPolicy = {362 edges?: FieldPolicy<any> | FieldReadFunction<any>;363 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;364 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;365};366export type MediaItemEdgeKeySpecifier = (367 | "cursor"368 | "node"369 | MediaItemEdgeKeySpecifier370)[];371export type MediaItemEdgeFieldPolicy = {372 cursor?: FieldPolicy<any> | FieldReadFunction<any>;373 node?: FieldPolicy<any> | FieldReadFunction<any>;374};375export type MutationKeySpecifier = (376 | "changePassword"377 | "createEntryWithAxios"378 | "createNewComment"379 | "createNewEntry"380 | "createNewProfile"381 | "nuevoEntry"382 | "registerNewUser"383 | "signin"384 | "updateUserPassword"385 | MutationKeySpecifier386)[];387export type MutationFieldPolicy = {388 changePassword?: FieldPolicy<any> | FieldReadFunction<any>;389 createEntryWithAxios?: FieldPolicy<any> | FieldReadFunction<any>;390 createNewComment?: FieldPolicy<any> | FieldReadFunction<any>;391 createNewEntry?: FieldPolicy<any> | FieldReadFunction<any>;392 createNewProfile?: FieldPolicy<any> | FieldReadFunction<any>;393 nuevoEntry?: FieldPolicy<any> | FieldReadFunction<any>;394 registerNewUser?: FieldPolicy<any> | FieldReadFunction<any>;395 signin?: FieldPolicy<any> | FieldReadFunction<any>;396 updateUserPassword?: FieldPolicy<any> | FieldReadFunction<any>;397};398export type NodeKeySpecifier = ("id" | NodeKeySpecifier)[];399export type NodeFieldPolicy = {400 id?: FieldPolicy<any> | FieldReadFunction<any>;401};402export type NodeUnionConnectionKeySpecifier = (403 | "edges"404 | "pageInfo"405 | "totalCount"406 | NodeUnionConnectionKeySpecifier407)[];408export type NodeUnionConnectionFieldPolicy = {409 edges?: FieldPolicy<any> | FieldReadFunction<any>;410 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;411 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;412};413export type NodeUnionEdgeKeySpecifier = (414 | "cursor"415 | "node"416 | NodeUnionEdgeKeySpecifier417)[];418export type NodeUnionEdgeFieldPolicy = {419 cursor?: FieldPolicy<any> | FieldReadFunction<any>;420 node?: FieldPolicy<any> | FieldReadFunction<any>;421};422export type PageInfoKeySpecifier = (423 | "endCursor"424 | "hasNextPage"425 | "hasPreviousPage"426 | "startCursor"427 | PageInfoKeySpecifier428)[];429export type PageInfoFieldPolicy = {430 endCursor?: FieldPolicy<any> | FieldReadFunction<any>;431 hasNextPage?: FieldPolicy<any> | FieldReadFunction<any>;432 hasPreviousPage?: FieldPolicy<any> | FieldReadFunction<any>;433 startCursor?: FieldPolicy<any> | FieldReadFunction<any>;434};435export type ProfileKeySpecifier = (436 | "activiyFeed"437 | "bio"438 | "city"439 | "country"440 | "coverPhoto"441 | "dob"442 | "gender"443 | "id"444 | "lastSeen"445 | "memberSince"446 | "occupation"447 | "phoneNumber"448 | "pronouns"449 | "recentActivity"450 | "user"451 | "userId"452 | "userInProfile"453 | ProfileKeySpecifier454)[];455export type ProfileFieldPolicy = {456 activiyFeed?: FieldPolicy<any> | FieldReadFunction<any>;457 bio?: FieldPolicy<any> | FieldReadFunction<any>;458 city?: FieldPolicy<any> | FieldReadFunction<any>;459 country?: FieldPolicy<any> | FieldReadFunction<any>;460 coverPhoto?: FieldPolicy<any> | FieldReadFunction<any>;461 dob?: FieldPolicy<any> | FieldReadFunction<any>;462 gender?: FieldPolicy<any> | FieldReadFunction<any>;463 id?: FieldPolicy<any> | FieldReadFunction<any>;464 lastSeen?: FieldPolicy<any> | FieldReadFunction<any>;465 memberSince?: FieldPolicy<any> | FieldReadFunction<any>;466 occupation?: FieldPolicy<any> | FieldReadFunction<any>;467 phoneNumber?: FieldPolicy<any> | FieldReadFunction<any>;468 pronouns?: FieldPolicy<any> | FieldReadFunction<any>;469 recentActivity?: FieldPolicy<any> | FieldReadFunction<any>;470 user?: FieldPolicy<any> | FieldReadFunction<any>;471 userId?: FieldPolicy<any> | FieldReadFunction<any>;472 userInProfile?: FieldPolicy<any> | FieldReadFunction<any>;473};474export type ProfileConnectionKeySpecifier = (475 | "edges"476 | "pageInfo"477 | "totalCount"478 | ProfileConnectionKeySpecifier479)[];480export type ProfileConnectionFieldPolicy = {481 edges?: FieldPolicy<any> | FieldReadFunction<any>;482 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;483 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;484};485export type ProfileEdgeKeySpecifier = (486 | "cursor"487 | "node"488 | ProfileEdgeKeySpecifier489)[];490export type ProfileEdgeFieldPolicy = {491 cursor?: FieldPolicy<any> | FieldReadFunction<any>;492 node?: FieldPolicy<any> | FieldReadFunction<any>;493};494export type QueryKeySpecifier = (495 | "categoryByRelayId"496 | "commentByRelayId"497 | "comprehensiveConnectionUnion"498 | "connectionByRelayId"499 | "contentNodesUnion"500 | "entryById"501 | "entryByRelayId"502 | "findUniqueMediaItem"503 | "getUserFromAccessToken"504 | "getViewer"505 | "listCategories"506 | "listComments"507 | "listConnections"508 | "listEntries"509 | "listMediaItems"510 | "listProfiles"511 | "listSessions"512 | "listUsers"513 | "me"514 | "node"515 | "nodeField"516 | "nodeUnionResolver"517 | "profileByRelayId"518 | "sessionByRelayId"519 | "siftEntries"520 | "userById"521 | "userByRelayId"522 | "viewer"523 | "viewerAuthInfoFromContext"524 | "viewerCommentsPaginated"525 | "viewerEntriesPaginated"526 | "viewerFieldsPaginated"527 | "viewerMediaItemsPaginated"528 | "viewerProfile"529 | "viewerSessionsPaginated"530 | QueryKeySpecifier531)[];532export type QueryFieldPolicy = {533 categoryByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;534 commentByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;535 comprehensiveConnectionUnion?: FieldPolicy<any> | FieldReadFunction<any>;536 connectionByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;537 contentNodesUnion?: FieldPolicy<any> | FieldReadFunction<any>;538 entryById?: FieldPolicy<any> | FieldReadFunction<any>;539 entryByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;540 findUniqueMediaItem?: FieldPolicy<any> | FieldReadFunction<any>;541 getUserFromAccessToken?: FieldPolicy<any> | FieldReadFunction<any>;542 getViewer?: FieldPolicy<any> | FieldReadFunction<any>;543 listCategories?: FieldPolicy<any> | FieldReadFunction<any>;544 listComments?: FieldPolicy<any> | FieldReadFunction<any>;545 listConnections?: FieldPolicy<any> | FieldReadFunction<any>;546 listEntries?: FieldPolicy<any> | FieldReadFunction<any>;547 listMediaItems?: FieldPolicy<any> | FieldReadFunction<any>;548 listProfiles?: FieldPolicy<any> | FieldReadFunction<any>;549 listSessions?: FieldPolicy<any> | FieldReadFunction<any>;550 listUsers?: FieldPolicy<any> | FieldReadFunction<any>;551 me?: FieldPolicy<any> | FieldReadFunction<any>;552 node?: FieldPolicy<any> | FieldReadFunction<any>;553 nodeField?: FieldPolicy<any> | FieldReadFunction<any>;554 nodeUnionResolver?: FieldPolicy<any> | FieldReadFunction<any>;555 profileByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;556 sessionByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;557 siftEntries?: FieldPolicy<any> | FieldReadFunction<any>;558 userById?: FieldPolicy<any> | FieldReadFunction<any>;559 userByRelayId?: FieldPolicy<any> | FieldReadFunction<any>;560 viewer?: FieldPolicy<any> | FieldReadFunction<any>;561 viewerAuthInfoFromContext?: FieldPolicy<any> | FieldReadFunction<any>;562 viewerCommentsPaginated?: FieldPolicy<any> | FieldReadFunction<any>;563 viewerEntriesPaginated?: FieldPolicy<any> | FieldReadFunction<any>;564 viewerFieldsPaginated?: FieldPolicy<any> | FieldReadFunction<any>;565 viewerMediaItemsPaginated?: FieldPolicy<any> | FieldReadFunction<any>;566 viewerProfile?: FieldPolicy<any> | FieldReadFunction<any>;567 viewerSessionsPaginated?: FieldPolicy<any> | FieldReadFunction<any>;568};569export type SessionKeySpecifier = (570 | "accessToken"571 | "alg"572 | "exp"573 | "iat"574 | "id"575 | "lastVerified"576 | "provider"577 | "refreshToken"578 | "scopes"579 | "signature"580 | "tokenState"581 | "user"582 | "userId"583 | SessionKeySpecifier584)[];585export type SessionFieldPolicy = {586 accessToken?: FieldPolicy<any> | FieldReadFunction<any>;587 alg?: FieldPolicy<any> | FieldReadFunction<any>;588 exp?: FieldPolicy<any> | FieldReadFunction<any>;589 iat?: FieldPolicy<any> | FieldReadFunction<any>;590 id?: FieldPolicy<any> | FieldReadFunction<any>;591 lastVerified?: FieldPolicy<any> | FieldReadFunction<any>;592 provider?: FieldPolicy<any> | FieldReadFunction<any>;593 refreshToken?: FieldPolicy<any> | FieldReadFunction<any>;594 scopes?: FieldPolicy<any> | FieldReadFunction<any>;595 signature?: FieldPolicy<any> | FieldReadFunction<any>;596 tokenState?: FieldPolicy<any> | FieldReadFunction<any>;597 user?: FieldPolicy<any> | FieldReadFunction<any>;598 userId?: FieldPolicy<any> | FieldReadFunction<any>;599};600export type SessionConnectionKeySpecifier = (601 | "edges"602 | "pageInfo"603 | "totalCount"604 | SessionConnectionKeySpecifier605)[];606export type SessionConnectionFieldPolicy = {607 edges?: FieldPolicy<any> | FieldReadFunction<any>;608 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;609 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;610};611export type SessionEdgeKeySpecifier = (612 | "cursor"613 | "node"614 | SessionEdgeKeySpecifier615)[];616export type SessionEdgeFieldPolicy = {617 cursor?: FieldPolicy<any> | FieldReadFunction<any>;618 node?: FieldPolicy<any> | FieldReadFunction<any>;619};620export type SubscriptionKeySpecifier = (621 | "commentCreated"622 | "entryCreated"623 | "profileCreated"624 | SubscriptionKeySpecifier625)[];626export type SubscriptionFieldPolicy = {627 commentCreated?: FieldPolicy<any> | FieldReadFunction<any>;628 entryCreated?: FieldPolicy<any> | FieldReadFunction<any>;629 profileCreated?: FieldPolicy<any> | FieldReadFunction<any>;630};631export type UserKeySpecifier = (632 | "_count"633 | "accounts"634 | "categories"635 | "comments"636 | "connections"637 | "createdAt"638 | "email"639 | "emailVerified"640 | "entries"641 | "firstName"642 | "id"643 | "image"644 | "lastName"645 | "mediaItems"646 | "password"647 | "profile"648 | "role"649 | "sessions"650 | "status"651 | "updatedAt"652 | UserKeySpecifier653)[];654export type UserFieldPolicy = {655 _count?: FieldPolicy<any> | FieldReadFunction<any>;656 accounts?: FieldPolicy<any> | FieldReadFunction<any>;657 categories?: FieldPolicy<any> | FieldReadFunction<any>;658 comments?: FieldPolicy<any> | FieldReadFunction<any>;659 connections?: FieldPolicy<any> | FieldReadFunction<any>;660 createdAt?: FieldPolicy<any> | FieldReadFunction<any>;661 email?: FieldPolicy<any> | FieldReadFunction<any>;662 emailVerified?: FieldPolicy<any> | FieldReadFunction<any>;663 entries?: FieldPolicy<any> | FieldReadFunction<any>;664 firstName?: FieldPolicy<any> | FieldReadFunction<any>;665 id?: FieldPolicy<any> | FieldReadFunction<any>;666 image?: FieldPolicy<any> | FieldReadFunction<any>;667 lastName?: FieldPolicy<any> | FieldReadFunction<any>;668 mediaItems?: FieldPolicy<any> | FieldReadFunction<any>;669 password?: FieldPolicy<any> | FieldReadFunction<any>;670 profile?: FieldPolicy<any> | FieldReadFunction<any>;671 role?: FieldPolicy<any> | FieldReadFunction<any>;672 sessions?: FieldPolicy<any> | FieldReadFunction<any>;673 status?: FieldPolicy<any> | FieldReadFunction<any>;674 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;675};676export type UserConnectionKeySpecifier = (677 | "edges"678 | "pageInfo"679 | "totalCount"680 | UserConnectionKeySpecifier681)[];682export type UserConnectionFieldPolicy = {683 edges?: FieldPolicy<any> | FieldReadFunction<any>;684 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;685 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;686};687export type UserCountKeySpecifier = (688 | "accounts"689 | "categories"690 | "comments"691 | "connections"692 | "entries"693 | "mediaItems"694 | "sessions"695 | UserCountKeySpecifier696)[];697export type UserCountFieldPolicy = {698 accounts?: FieldPolicy<any> | FieldReadFunction<any>;699 categories?: FieldPolicy<any> | FieldReadFunction<any>;700 comments?: FieldPolicy<any> | FieldReadFunction<any>;701 connections?: FieldPolicy<any> | FieldReadFunction<any>;702 entries?: FieldPolicy<any> | FieldReadFunction<any>;703 mediaItems?: FieldPolicy<any> | FieldReadFunction<any>;704 sessions?: FieldPolicy<any> | FieldReadFunction<any>;705};706export type UserEdgeKeySpecifier = (707 | "cursor"708 | "node"709 | UserEdgeKeySpecifier710)[];711export type UserEdgeFieldPolicy = {712 cursor?: FieldPolicy<any> | FieldReadFunction<any>;713 node?: FieldPolicy<any> | FieldReadFunction<any>;714};715export type ViewerAuthInfoKeySpecifier = (716 | "accessToken"717 | "refreshToken"718 | "viewerJwt"719 | ViewerAuthInfoKeySpecifier720)[];721export type ViewerAuthInfoFieldPolicy = {722 accessToken?: FieldPolicy<any> | FieldReadFunction<any>;723 refreshToken?: FieldPolicy<any> | FieldReadFunction<any>;724 viewerJwt?: FieldPolicy<any> | FieldReadFunction<any>;725};726export type ViewerDetailedKeySpecifier = (727 | "_count"728 | "accessToken"729 | "accounts"730 | "categories"731 | "comments"732 | "connections"733 | "createdAt"734 | "email"735 | "emailVerified"736 | "entries"737 | "firstName"738 | "id"739 | "image"740 | "lastName"741 | "mediaItems"742 | "password"743 | "profile"744 | "refreshToken"745 | "role"746 | "secret"747 | "sessions"748 | "status"749 | "updatedAt"750 | ViewerDetailedKeySpecifier751)[];752export type ViewerDetailedFieldPolicy = {753 _count?: FieldPolicy<any> | FieldReadFunction<any>;754 accessToken?: FieldPolicy<any> | FieldReadFunction<any>;755 accounts?: FieldPolicy<any> | FieldReadFunction<any>;756 categories?: FieldPolicy<any> | FieldReadFunction<any>;757 comments?: FieldPolicy<any> | FieldReadFunction<any>;758 connections?: FieldPolicy<any> | FieldReadFunction<any>;759 createdAt?: FieldPolicy<any> | FieldReadFunction<any>;760 email?: FieldPolicy<any> | FieldReadFunction<any>;761 emailVerified?: FieldPolicy<any> | FieldReadFunction<any>;762 entries?: FieldPolicy<any> | FieldReadFunction<any>;763 firstName?: FieldPolicy<any> | FieldReadFunction<any>;764 id?: FieldPolicy<any> | FieldReadFunction<any>;765 image?: FieldPolicy<any> | FieldReadFunction<any>;766 lastName?: FieldPolicy<any> | FieldReadFunction<any>;767 mediaItems?: FieldPolicy<any> | FieldReadFunction<any>;768 password?: FieldPolicy<any> | FieldReadFunction<any>;769 profile?: FieldPolicy<any> | FieldReadFunction<any>;770 refreshToken?: FieldPolicy<any> | FieldReadFunction<any>;771 role?: FieldPolicy<any> | FieldReadFunction<any>;772 secret?: FieldPolicy<any> | FieldReadFunction<any>;773 sessions?: FieldPolicy<any> | FieldReadFunction<any>;774 status?: FieldPolicy<any> | FieldReadFunction<any>;775 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;776};777export type ViewerFieldsPaginatedKeySpecifier = (778 | "_count"779 | "commentConnection"780 | "createdAt"781 | "email"782 | "emailVerified"783 | "entryConnection"784 | "firstName"785 | "id"786 | "image"787 | "lastName"788 | "mediaItemConnection"789 | "password"790 | "profile"791 | "role"792 | "sessionConnection"793 | "status"794 | "updatedAt"795 | ViewerFieldsPaginatedKeySpecifier796)[];797export type ViewerFieldsPaginatedFieldPolicy = {798 _count?: FieldPolicy<any> | FieldReadFunction<any>;799 commentConnection?: FieldPolicy<any> | FieldReadFunction<any>;800 createdAt?: FieldPolicy<any> | FieldReadFunction<any>;801 email?: FieldPolicy<any> | FieldReadFunction<any>;802 emailVerified?: FieldPolicy<any> | FieldReadFunction<any>;803 entryConnection?: FieldPolicy<any> | FieldReadFunction<any>;804 firstName?: FieldPolicy<any> | FieldReadFunction<any>;805 id?: FieldPolicy<any> | FieldReadFunction<any>;806 image?: FieldPolicy<any> | FieldReadFunction<any>;807 lastName?: FieldPolicy<any> | FieldReadFunction<any>;808 mediaItemConnection?: FieldPolicy<any> | FieldReadFunction<any>;809 password?: FieldPolicy<any> | FieldReadFunction<any>;810 profile?: FieldPolicy<any> | FieldReadFunction<any>;811 role?: FieldPolicy<any> | FieldReadFunction<any>;812 sessionConnection?: FieldPolicy<any> | FieldReadFunction<any>;813 status?: FieldPolicy<any> | FieldReadFunction<any>;814 updatedAt?: FieldPolicy<any> | FieldReadFunction<any>;815};816export type ViewerFieldsPaginatedConnectionKeySpecifier = (817 | "edges"818 | "pageInfo"819 | "totalCount"820 | ViewerFieldsPaginatedConnectionKeySpecifier821)[];822export type ViewerFieldsPaginatedConnectionFieldPolicy = {823 edges?: FieldPolicy<any> | FieldReadFunction<any>;824 pageInfo?: FieldPolicy<any> | FieldReadFunction<any>;825 totalCount?: FieldPolicy<any> | FieldReadFunction<any>;826};827export type ViewerFieldsPaginatedEdgeKeySpecifier = (828 | "cursor"829 | "node"830 | ViewerFieldsPaginatedEdgeKeySpecifier831)[];832export type ViewerFieldsPaginatedEdgeFieldPolicy = {833 cursor?: FieldPolicy<any> | FieldReadFunction<any>;834 node?: FieldPolicy<any> | FieldReadFunction<any>;835};836export type StrictTypedTypePolicies = {837 Account?: Omit<TypePolicy, "fields" | "keyFields"> & {838 keyFields?:839 | false840 | AccountKeySpecifier841 | (() => undefined | AccountKeySpecifier);842 fields?: AccountFieldPolicy;843 };844 Auth?: Omit<TypePolicy, "fields" | "keyFields"> & {845 keyFields?:846 | false847 | AuthKeySpecifier848 | (() => undefined | AuthKeySpecifier);849 fields?: AuthFieldPolicy;850 };851 AuthDetailed?: Omit<TypePolicy, "fields" | "keyFields"> & {852 keyFields?:853 | false854 | AuthDetailedKeySpecifier855 | (() => undefined | AuthDetailedKeySpecifier);856 fields?: AuthDetailedFieldPolicy;857 };858 BaseTypeNodes?: Omit<TypePolicy, "fields" | "keyFields"> & {859 keyFields?:860 | false861 | BaseTypeNodesKeySpecifier862 | (() => undefined | BaseTypeNodesKeySpecifier);863 fields?: BaseTypeNodesFieldPolicy;864 };865 BaseTypesEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {866 keyFields?:867 | false868 | BaseTypesEdgeKeySpecifier869 | (() => undefined | BaseTypesEdgeKeySpecifier);870 fields?: BaseTypesEdgeFieldPolicy;871 };872 Category?: Omit<TypePolicy, "fields" | "keyFields"> & {873 keyFields?:874 | false875 | CategoryKeySpecifier876 | (() => undefined | CategoryKeySpecifier);877 fields?: CategoryFieldPolicy;878 };879 CategoryConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {880 keyFields?:881 | false882 | CategoryConnectionKeySpecifier883 | (() => undefined | CategoryConnectionKeySpecifier);884 fields?: CategoryConnectionFieldPolicy;885 };886 CategoryCount?: Omit<TypePolicy, "fields" | "keyFields"> & {887 keyFields?:888 | false889 | CategoryCountKeySpecifier890 | (() => undefined | CategoryCountKeySpecifier);891 fields?: CategoryCountFieldPolicy;892 };893 CategoryEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {894 keyFields?:895 | false896 | CategoryEdgeKeySpecifier897 | (() => undefined | CategoryEdgeKeySpecifier);898 fields?: CategoryEdgeFieldPolicy;899 };900 Comment?: Omit<TypePolicy, "fields" | "keyFields"> & {901 keyFields?:902 | false903 | CommentKeySpecifier904 | (() => undefined | CommentKeySpecifier);905 fields?: CommentFieldPolicy;906 };907 CommentConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {908 keyFields?:909 | false910 | CommentConnectionKeySpecifier911 | (() => undefined | CommentConnectionKeySpecifier);912 fields?: CommentConnectionFieldPolicy;913 };914 CommentEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {915 keyFields?:916 | false917 | CommentEdgeKeySpecifier918 | (() => undefined | CommentEdgeKeySpecifier);919 fields?: CommentEdgeFieldPolicy;920 };921 Connection?: Omit<TypePolicy, "fields" | "keyFields"> & {922 keyFields?:923 | false924 | ConnectionKeySpecifier925 | (() => undefined | ConnectionKeySpecifier);926 fields?: ConnectionFieldPolicy;927 };928 ConnectionConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {929 keyFields?:930 | false931 | ConnectionConnectionKeySpecifier932 | (() => undefined | ConnectionConnectionKeySpecifier);933 fields?: ConnectionConnectionFieldPolicy;934 };935 ConnectionEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {936 keyFields?:937 | false938 | ConnectionEdgeKeySpecifier939 | (() => undefined | ConnectionEdgeKeySpecifier);940 fields?: ConnectionEdgeFieldPolicy;941 };942 ContentNodes?: Omit<TypePolicy, "fields" | "keyFields"> & {943 keyFields?:944 | false945 | ContentNodesKeySpecifier946 | (() => undefined | ContentNodesKeySpecifier);947 fields?: ContentNodesFieldPolicy;948 };949 Entry?: Omit<TypePolicy, "fields" | "keyFields"> & {950 keyFields?:951 | false952 | EntryKeySpecifier953 | (() => undefined | EntryKeySpecifier);954 fields?: EntryFieldPolicy;955 };956 EntryConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {957 keyFields?:958 | false959 | EntryConnectionKeySpecifier960 | (() => undefined | EntryConnectionKeySpecifier);961 fields?: EntryConnectionFieldPolicy;962 };963 EntryCount?: Omit<TypePolicy, "fields" | "keyFields"> & {964 keyFields?:965 | false966 | EntryCountKeySpecifier967 | (() => undefined | EntryCountKeySpecifier);968 fields?: EntryCountFieldPolicy;969 };970 EntryEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {971 keyFields?:972 | false973 | EntryEdgeKeySpecifier974 | (() => undefined | EntryEdgeKeySpecifier);975 fields?: EntryEdgeFieldPolicy;976 };977 JwtDecoded?: Omit<TypePolicy, "fields" | "keyFields"> & {978 keyFields?:979 | false980 | JwtDecodedKeySpecifier981 | (() => undefined | JwtDecodedKeySpecifier);982 fields?: JwtDecodedFieldPolicy;983 };984 JwtHeaders?: Omit<TypePolicy, "fields" | "keyFields"> & {985 keyFields?:986 | false987 | JwtHeadersKeySpecifier988 | (() => undefined | JwtHeadersKeySpecifier);989 fields?: JwtHeadersFieldPolicy;990 };991 JwtPayload?: Omit<TypePolicy, "fields" | "keyFields"> & {992 keyFields?:993 | false994 | JwtPayloadKeySpecifier995 | (() => undefined | JwtPayloadKeySpecifier);996 fields?: JwtPayloadFieldPolicy;997 };998 MediaItem?: Omit<TypePolicy, "fields" | "keyFields"> & {999 keyFields?:1000 | false1001 | MediaItemKeySpecifier1002 | (() => undefined | MediaItemKeySpecifier);1003 fields?: MediaItemFieldPolicy;1004 };1005 MediaItemConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {1006 keyFields?:1007 | false1008 | MediaItemConnectionKeySpecifier1009 | (() => undefined | MediaItemConnectionKeySpecifier);1010 fields?: MediaItemConnectionFieldPolicy;1011 };1012 MediaItemEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {1013 keyFields?:1014 | false1015 | MediaItemEdgeKeySpecifier1016 | (() => undefined | MediaItemEdgeKeySpecifier);1017 fields?: MediaItemEdgeFieldPolicy;1018 };1019 Mutation?: Omit<TypePolicy, "fields" | "keyFields"> & {1020 keyFields?:1021 | false1022 | MutationKeySpecifier1023 | (() => undefined | MutationKeySpecifier);1024 fields?: MutationFieldPolicy;1025 };1026 Node?: Omit<TypePolicy, "fields" | "keyFields"> & {1027 keyFields?:1028 | false1029 | NodeKeySpecifier1030 | (() => undefined | NodeKeySpecifier);1031 fields?: NodeFieldPolicy;1032 };1033 NodeUnionConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {1034 keyFields?:1035 | false1036 | NodeUnionConnectionKeySpecifier1037 | (() => undefined | NodeUnionConnectionKeySpecifier);1038 fields?: NodeUnionConnectionFieldPolicy;1039 };1040 NodeUnionEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {1041 keyFields?:1042 | false1043 | NodeUnionEdgeKeySpecifier1044 | (() => undefined | NodeUnionEdgeKeySpecifier);1045 fields?: NodeUnionEdgeFieldPolicy;1046 };1047 PageInfo?: Omit<TypePolicy, "fields" | "keyFields"> & {1048 keyFields?:1049 | false1050 | PageInfoKeySpecifier1051 | (() => undefined | PageInfoKeySpecifier);1052 fields?: PageInfoFieldPolicy;1053 };1054 Profile?: Omit<TypePolicy, "fields" | "keyFields"> & {1055 keyFields?:1056 | false1057 | ProfileKeySpecifier1058 | (() => undefined | ProfileKeySpecifier);1059 fields?: ProfileFieldPolicy;1060 };1061 ProfileConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {1062 keyFields?:1063 | false1064 | ProfileConnectionKeySpecifier1065 | (() => undefined | ProfileConnectionKeySpecifier);1066 fields?: ProfileConnectionFieldPolicy;1067 };1068 ProfileEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {1069 keyFields?:1070 | false1071 | ProfileEdgeKeySpecifier1072 | (() => undefined | ProfileEdgeKeySpecifier);1073 fields?: ProfileEdgeFieldPolicy;1074 };1075 Query?: Omit<TypePolicy, "fields" | "keyFields"> & {1076 keyFields?:1077 | false1078 | QueryKeySpecifier1079 | (() => undefined | QueryKeySpecifier);1080 fields?: QueryFieldPolicy;1081 };1082 Session?: Omit<TypePolicy, "fields" | "keyFields"> & {1083 keyFields?:1084 | false1085 | SessionKeySpecifier1086 | (() => undefined | SessionKeySpecifier);1087 fields?: SessionFieldPolicy;1088 };1089 SessionConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {1090 keyFields?:1091 | false1092 | SessionConnectionKeySpecifier1093 | (() => undefined | SessionConnectionKeySpecifier);1094 fields?: SessionConnectionFieldPolicy;1095 };1096 SessionEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {1097 keyFields?:1098 | false1099 | SessionEdgeKeySpecifier1100 | (() => undefined | SessionEdgeKeySpecifier);1101 fields?: SessionEdgeFieldPolicy;1102 };1103 Subscription?: Omit<TypePolicy, "fields" | "keyFields"> & {1104 keyFields?:1105 | false1106 | SubscriptionKeySpecifier1107 | (() => undefined | SubscriptionKeySpecifier);1108 fields?: SubscriptionFieldPolicy;1109 };1110 User?: Omit<TypePolicy, "fields" | "keyFields"> & {1111 keyFields?:1112 | false1113 | UserKeySpecifier1114 | (() => undefined | UserKeySpecifier);1115 fields?: UserFieldPolicy;1116 };1117 UserConnection?: Omit<TypePolicy, "fields" | "keyFields"> & {1118 keyFields?:1119 | false1120 | UserConnectionKeySpecifier1121 | (() => undefined | UserConnectionKeySpecifier);1122 fields?: UserConnectionFieldPolicy;1123 };1124 UserCount?: Omit<TypePolicy, "fields" | "keyFields"> & {1125 keyFields?:1126 | false1127 | UserCountKeySpecifier1128 | (() => undefined | UserCountKeySpecifier);1129 fields?: UserCountFieldPolicy;1130 };1131 UserEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {1132 keyFields?:1133 | false1134 | UserEdgeKeySpecifier1135 | (() => undefined | UserEdgeKeySpecifier);1136 fields?: UserEdgeFieldPolicy;1137 };1138 ViewerAuthInfo?: Omit<TypePolicy, "fields" | "keyFields"> & {1139 keyFields?:1140 | false1141 | ViewerAuthInfoKeySpecifier1142 | (() => undefined | ViewerAuthInfoKeySpecifier);1143 fields?: ViewerAuthInfoFieldPolicy;1144 };1145 ViewerDetailed?: Omit<TypePolicy, "fields" | "keyFields"> & {1146 keyFields?:1147 | false1148 | ViewerDetailedKeySpecifier1149 | (() => undefined | ViewerDetailedKeySpecifier);1150 fields?: ViewerDetailedFieldPolicy;1151 };1152 ViewerFieldsPaginated?: Omit<TypePolicy, "fields" | "keyFields"> & {1153 keyFields?:1154 | false1155 | ViewerFieldsPaginatedKeySpecifier1156 | (() => undefined | ViewerFieldsPaginatedKeySpecifier);1157 fields?: ViewerFieldsPaginatedFieldPolicy;1158 };1159 ViewerFieldsPaginatedConnection?: Omit<1160 TypePolicy,1161 "fields" | "keyFields"1162 > & {1163 keyFields?:1164 | false1165 | ViewerFieldsPaginatedConnectionKeySpecifier1166 | (() => undefined | ViewerFieldsPaginatedConnectionKeySpecifier);1167 fields?: ViewerFieldsPaginatedConnectionFieldPolicy;1168 };1169 ViewerFieldsPaginatedEdge?: Omit<TypePolicy, "fields" | "keyFields"> & {1170 keyFields?:1171 | false1172 | ViewerFieldsPaginatedEdgeKeySpecifier1173 | (() => undefined | ViewerFieldsPaginatedEdgeKeySpecifier);1174 fields?: ViewerFieldsPaginatedEdgeFieldPolicy;1175 };1176};...
index.js
Source:index.js
1'use strict';2const { extname } = require('path');3function namedAssetImportPlugin({ types: t }) {4 const visited = new WeakSet();5 function generateNewSourcePath(loaderMap, moduleName, sourcePath) {6 const ext = extname(sourcePath).substr(1);7 const extMap = loaderMap[ext];8 return extMap[moduleName]9 ? extMap[moduleName].replace(/\[path\]/, sourcePath)10 : sourcePath;11 }12 function replaceMatchingSpecifiers(path, loaderMap, callback) {13 const sourcePath = path.node.source.value;14 const ext = extname(sourcePath).substr(1);15 if (visited.has(path.node) || sourcePath.indexOf('!') !== -1) {16 return;17 }18 if (loaderMap[ext]) {19 path.replaceWithMultiple(20 path.node.specifiers.map(specifier => {21 const newSpecifier = callback(specifier, sourcePath);22 visited.add(newSpecifier);23 return newSpecifier;24 })25 );26 }27 }28 return {29 visitor: {30 ExportNamedDeclaration(path, { opts: { loaderMap } }) {31 if (!path.node.source) {32 return;33 }34 replaceMatchingSpecifiers(path, loaderMap, (specifier, sourcePath) => {35 if (t.isExportDefaultSpecifier(specifier)) {36 return t.exportDeclaration(37 [t.exportDefaultSpecifier(t.identifier(specifier.local.name))],38 t.stringLiteral(sourcePath)39 );40 }41 return t.exportNamedDeclaration(42 null,43 [44 t.exportSpecifier(45 t.identifier(specifier.local.name),46 t.identifier(specifier.exported.name)47 ),48 ],49 t.stringLiteral(50 generateNewSourcePath(loaderMap, specifier.local.name, sourcePath)51 )52 );53 });54 },55 ImportDeclaration(path, { opts: { loaderMap } }) {56 replaceMatchingSpecifiers(path, loaderMap, (specifier, sourcePath) => {57 if (t.isImportDefaultSpecifier(specifier)) {58 return t.importDeclaration(59 [t.importDefaultSpecifier(t.identifier(specifier.local.name))],60 t.stringLiteral(sourcePath)61 );62 }63 return t.importDeclaration(64 [65 t.importSpecifier(66 t.identifier(specifier.local.name),67 t.identifier(specifier.imported.name)68 ),69 ],70 t.stringLiteral(71 generateNewSourcePath(72 loaderMap,73 specifier.imported.name,74 sourcePath75 )76 )77 );78 });79 },80 },81 };82}...
Using AI Code Generation
1import { configure } from '@storybook/react';2import { setOptions } from '@storybook/addon-options';3import { setDefaults } from '@storybook/addon-info';4import { setDefaults as setAddonInfo } from '@storybook/addon-info';5import { setDefaults as setAddonKnobs } from '@storybook/addon-knobs';6import { setDefaults as setAddonActions } from '@storybook/addon-actions';7setAddonInfo({8});9setAddonKnobs({10});11setAddonActions({12});13setOptions({
Using AI Code Generation
1import { withRootDecorator } from 'storybook-root-decorator';2import { withTests } from '@storybook/addon-jest';3import { withA11y } from '@storybook/addon-a11y';4import results from '../.jest-test-results.json';5 withTests({ results }),6];7import { addDecorator } from '@storybook/react';8import { withRootDecorator } from 'storybook-root-decorator';9addDecorator(withRootDecorator);10import { addDecorator } from '@storybook/react';11import { withRootDecorator } from 'storybook-root-decorator';12addDecorator(withRootDecorator);13import { addDecorator } from '@storybook/react';14import { withRootDecorator } from 'storybook-root-decorator';15addDecorator(withRootDecorator);16import { addDecorator } from '@storybook/react';17import { withRootDecorator } from 'storybook-root-decorator';18addDecorator(withRootDecorator);19import { addDecorator } from '@storybook/react';20import { withRootDecorator } from 'storybook-root-decorator';21addDecorator(withRootDecorator);22import { addDecorator } from '@storybook/react';23import { withRootDecorator } from 'storybook-root-decorator';24addDecorator(withRootDecorator);25import { addDecorator } from '@storybook/react';26import { withRootDecorator } from 'storybook-root-decorator';27addDecorator(withRootDecorator);28import { addDecorator } from '@storybook/react';29import { withRootDecorator } from 'storybook-root-decorator';30addDecorator(withRootDecorator);31import { addDecorator } from '@storybook/react';32import { withRootDecorator } from 'storybook-root-decorator';33addDecorator(withRootDecorator);34import { addDecorator } from '@storybook/react';35import { withRootDecorator } from 'storybook-root-decorator';36addDecorator(withRootDecorator);37import { addDecorator } from '@storybook/react';38import { withRootDecorator } from 'storybook-root-de
Using AI Code Generation
1import { rootImport } from 'storybook-root-import';2rootImport({ rootPathSuffix: 'src' });3rootImport({ rootPathPrefix: '~' });4rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src' });5rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules'] });6rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'] });7rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'], webpackConfigPath: 'webpack.config.js' });8rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'], webpackConfigPath: 'webpack.config.js', include: ['src'] });9rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'], webpackConfigPath: 'webpack.config.js', include: ['src'], exclude: ['src'] });10rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'], webpackConfigPath: 'webpack.config.js', include: ['src'], exclude: ['src'], webpackConfig: {} });11rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'], webpackConfigPath: 'webpack.config.js', include: ['src'], exclude: ['src'], webpackConfig: {}, webpack: {} });12rootImport({ rootPathPrefix: '~', rootPathSuffix: 'src', ignore: ['node_modules', 'src'], webpackConfigPath: 'webpack.config.js', include: ['src'], exclude: ['src'], webpackConfig:
Using AI Code Generation
1import { storiesOf } from 'storybook-root-alias';2import { action } from '@storybook/addon-actions';3import { linkTo } from '@storybook/addon-links';4import { Button, Welcome } from '@storybook/react/demo';5import { withInfo } from '@storybook/addon-info';6import { withKnobs, text, boolean, number } from '@storybook/addon-knobs/react';7storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);8storiesOf('Button', module)9 .addDecorator(withKnobs)10 .add(11 withInfo('A very simple component')(() => (12 onClick={action('clicked')}13 disabled={boolean('Disabled', false)}14 backgroundColor={text('Background Color', 'yellow')}15 {text('Label', 'Hello Storybook')}16 .add(17 withInfo({18 <Button onClick={action('clicked')} disabled={boolean('Disabled', false)}>19 {text('Label', 'Hello Storybook')}20 })(() => (21 <Button onClick={action('clicked')} disabled={boolean('Disabled', false)}>22 {text('Label', '😀 😎 👍 💯')}23 );24const path = require('path');25const rootAlias = require('storybook-root-alias');26module.exports = {27 plugins: [rootAlias()],28 module: {29 {30 include: path.resolve(__dirname, '../src'),31 use: {32 options: {33 },34 },35 },36 },37};38import { configure } from '@storybook/react';39const req = require.context('../src', true, /\.stories\.js$/);
Using AI Code Generation
1import { root } from 'storybook-root';2root('src/components/HelloWorld.vue');3import { root } from 'storybook-root';4root('test.js');5import { root } from 'storybook-root';6root('src/components/HelloWorld.vue', 'src/components');7import { root } from 'storybook-root';8root('test.js', 'src/components');9import { root } from 'storybook-root';10root('src/components/HelloWorld.vue', 'src');11import { root } from 'storybook-root';12root('test.js', 'src');13import { root } from 'storybook-root';14root('src/components/HelloWorld.vue', 'src/components/HelloWorld.vue');15import { root } from 'storybook-root';16root('test.js', 'src/components/HelloWorld.vue');17[Shuhei Okada](
Using AI Code Generation
1import { createRootCausePage } from 'storybook-root-cause';2import { TestPage } from './TestPage';3import { TestPage2 } from './TestPage2';4export const Test = createRootCausePage({5});6export const Test2 = createRootCausePage({7});8import { createRootCausePage } from 'storybook-root-cause';9import { TestPage } from './TestPage';10import { TestPage2 } from './TestPage2';11export const Test = createRootCausePage({12});13export const Test2 = createRootCausePage({14});15import { createRootCausePage } from 'storybook-root-cause';16import { TestPage } from './TestPage';17import { TestPage2 } from './TestPage2';18export const Test = createRootCausePage({19});20export const Test2 = createRootCausePage({21});22import { createRootCausePage } from 'storybook-root-cause';23import { TestPage } from './TestPage';24import { TestPage2 } from './TestPage2';25export const Test = createRootCausePage({26});27export const Test2 = createRootCausePage({28});29import { createRootCausePage } from 'storybook-root-cause';30import { TestPage } from './TestPage';31import { TestPage2
Using AI Code Generation
1import { storybookRoot } from 'storybook-root'2import { storybookRoot } from 'storybook-root/specifier'3import { storybookRoot } from 'storybook-root'4storybookRoot.specifier()5import { storybookRoot } from 'storybook-root/specifier'6import { storybookRoot } from 'storybook-root'7storybookRoot.specifier()8import { storybookRoot } from 'storybook-root/specifier'9import { storybookRoot } from 'storybook-root'10storybookRoot.specifier()11import { storybookRoot } from 'storybook-root/specifier'12import { storybookRoot } from 'storybook-root'13storybookRoot.specifier()14import { storybookRoot } from 'storybook-root/specifier'15import { storybookRoot } from 'storybook-root'16storybookRoot.specifier()17import { storybookRoot } from 'storybook-root/specifier'18import { storybookRoot } from 'storybook-root'19storybookRoot.specifier()20import { storybookRoot } from 'storybook-root/specifier'21import { storybookRoot } from 'storybook-root'22storybookRoot.specifier()23import { storybookRoot } from 'storybook-root/specifier'24import { storybookRoot } from 'storybook-root'25storybookRoot.specifier()26import { storybookRoot } from 'storybook-root/specifier'27import { storybookRoot } from 'storybook-root'28storybookRoot.specifier()29import { storybookRoot } from 'storybook-root/specifier'30import { storybookRoot } from 'storybook-root'31storybookRoot.specifier()32import { storybookRoot } from 'storybook-root/specifier'33import { storybookRoot } from 'storybook-root'34storybookRoot.specifier()35import { storybookRoot } from 'storybook-root/specifier'36import { storybookRoot } from 'storybook-root'37storybookRoot.specifier()38import { storybookRoot } from 'storybook-root/specifier'39import { storybookRoot } from 'storybook-root'40storybookRoot.specifier()41import { storybookRoot } from 'storybook-root/specifier'42import { storybookRoot } from
Using AI Code Generation
1import { storybookRoot } from 'storybook-root';2const root = storybookRoot({3});4root.init();5import { storybookRoot } from 'storybook-root';6const root = storybookRoot({7});8root.init();9import { storybookRoot } from 'storybook-root';10const root = storybookRoot({11});12root.init();13import { storybookRoot } from 'storybook-root';14const root = storybookRoot({15});16root.init();17import { storybookRoot } from 'storybook-root';18const root = storybookRoot({19});20root.init();21import { storybookRoot } from 'storybook-root';22const root = storybookRoot({23});24root.init();25import { storybookRoot } from 'storybook-root';26const root = storybookRoot({27});28root.init();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!